09-05-2009, 01:37 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Feb 2009
Posts: 73
Thanks: 30
|
Basic Loop with [ str_replace]
I have a problem with replacing and looping.I need your help please to change
This line
Quote:
|
The quick brown {fox} jumps over the lazy {dog}
|
To this
Quote:
|
The quick brown cat jumps over the lazy mouse.
|
PHP Code:
$string = 'The quick brown {fox} jumps over the lazy {dog}'; $arr = array("fox" =>"Cat","dog"=>"mouse"); preg_match_all("/{.*?}/",$testing,$matches);
By the way how to practice looping in php ?
Is there any good exercise for it ?
|
|
|
|