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} Quote 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); Quote 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 Quote 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. Quote 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/ Quote Link to comment https://forums.phpfreaks.com/topic/220291-replace-string-string/#findComment-1141627 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.