Destramic Posted November 30, 2010 Share Posted November 30, 2010 hey guys just a simple one...im trying to replace {$name} but i dont think ive got the right prefix in the str_replace function...if anyone could tell me where i am going wrong please $content = str_replace("{/$".$variable."}", $value, $content); {$name} Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/ Share on other sites More sharing options...
BlueSkyIS Posted November 30, 2010 Share Posted November 30, 2010 you mean this? $content = str_replace('{$'.$variable.'}', $value, $content); Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/#findComment-1141563 Share on other sites More sharing options...
Destramic Posted November 30, 2010 Author Share Posted November 30, 2010 thank you that worked great...also one last thing....is it possible to use call_user_func on a class functuion?...thanks again Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/#findComment-1141566 Share on other sites More sharing options...
BlueSkyIS Posted November 30, 2010 Share Posted November 30, 2010 i didn't know, so i rtfm. :-) http://php.net/manual/en/function.call-user-func.php yes, apparently so. Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/#findComment-1141571 Share on other sites More sharing options...
JakeTheSnake3.0 Posted December 1, 2010 Share Posted December 1, 2010 Please mark your other post as solved http://www.phpfreaks.com/forums/php-coding-help/searching-for-a-string-inside-a-string-using-regex/ Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/#findComment-1141627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.