fork(1) download
  1. <?php
  2.  
  3. $meu_array = array("123_rui", "125_joao", "287_manuel");
  4. $procurar = "/123/";
  5. $substituir = "10";
  6. $meu_array = preg_replace($procurar, $substituir, $meu_array);
  7. echo "<pre>";
  8. print_r($meu_array);
  9. echo "</pre>";
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
<pre>Array
(
    [0] => 10_rui
    [1] => 125_joao
    [2] => 287_manuel
)
</pre>