Jump to content

Replacing by an indexed array row


Doodood

Recommended Posts

Hi, I'm having troubles using POSIX regex !

I know how to construct well-formed expressions, but hum... i'd like to replace some content by the row[$1] of an array...

 

My tries :

$query = preg_replace('#{([0-9]+)}#isU', $arr[$1], $this->query);
$query = preg_replace('#{([0-9]+)}#isU', $arr['$1'], $this->query);
$query = preg_replace('#{([0-9]+)}#isU', $arr["$1"], $this->query);
$query = preg_replace('#{([0-9]+)}#isU', "$arr[$1]", $this->query); 
$query = preg_replace('#{([0-9]+)}#isU', "$arr['$1']", $this->query); 

 

None of them worked... If you have any idea !

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/201940-replacing-by-an-indexed-array-row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.