Php - Foreach returning one value, first or last
<p>If I use return in my function, I will get only one value.</p>

<p>If I use echo, I get all the values. I don't get it.</p>

<pre><code>foreach($matches[0] as $matchbun)
{

        $var1 = str_split($matchbun, 34);
        $replace_line = "-";
        $var_final = str_replace($replace_line, " ", $var1[1]);

        $replace_url = array('google.com', '/name/');
        $replace_url_with = array('yahoo.com', '/url_');
        $url_final = str_replace($replace_url, $replace_url_with, $matchbun);



        return ''.ucfirst($url_final).'';

}
</code></pre>

<p>Seems that I can't insert the echoes into a database, they appear blank if I run the function.
What to do?</p>