Insert "do_action" into an array at a specific index (PHP)
<p>Has anyone ever been able to insert the output from do_action into an array at a specific index? For example, if you have the array and function below:</p>

<pre><code>$myarr = array(1,2,3,4);

 my_function(){
  return 4 + 4;
}
</code></pre>

<p>I'm trying to do: </p>

<pre><code>array_splice($myarr, 2, 0, do_action('my_function'););
</code></pre>

<p>And have it output:</p>

<pre><code>[1, 2, 8, 3, 4]
</code></pre>

<p>I'm trying to integrate something like this in a wordpress page, and it breaks my entire page.</p>