Advertisement
Guest User

Untitled

a guest
Oct 27th, 2014
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. $recursos_data = array(
  3.     array(
  4.         "id" => "0",
  5.         "recurso_nome" => "madeira",
  6.         "producao" => "%produz%",
  7.         "estoque" => "200"
  8.     ),
  9.     array(
  10.         "id" => "1",
  11.         "recurso_nome" => "comida",
  12.         "producao" => "%produz%",
  13.         "estoque" => "100"
  14.     )
  15. );
  16. foreach($recursos_data as $recurso):
  17.     $retornar = preg_replace("/%produz%/", '500', $recursos_data[$recurso['id']]);
  18. endforeach;
  19. return $retornar
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement