How to str_replace a section of PHP Code
Posted
by whatshakin
on Stack Overflow
See other posts from Stack Overflow
or by whatshakin
Published on 2010-03-17T00:43:17Z
Indexed on
2010/03/17
1:11 UTC
Read the original article
Hit count: 299
php
|str-replace
$embedCode = <<<EOF
getApplicationContent('video','player',array('id' => $iFileId, 'user' => $this->iViewer, 'password' => clear_xss($_COOKIE['memberPassword'])),true)
EOF;
$name = str_replace($embedCode,"test",$content);
I'm trying to replace a section of code with another piece of code. I can do it with smaller strings but once I added the larger strings to $embedCode, it throw an "unexpected T_ENCAPSED_AND_WHITESPACE" error
© Stack Overflow or respective owner