Guest qsdk Posted October 30, 2005 Share Posted October 30, 2005 how to substitute in php?in perl i find it : $file=~s/name/"$name"/eg;but i dont know how it in php.help me! Link to comment Share on other sites More sharing options...
bradley.lee Posted October 30, 2005 Share Posted October 30, 2005 what do you mean by substitute, I know a bit of php but no perl Link to comment Share on other sites More sharing options...
actionsketch Posted October 31, 2005 Share Posted October 31, 2005 if you want to insert a variable into a string you can do it like this:"my variable equals ".$myvariable." units of greatness!"or"my variable equals {$myvariable} units of greatness!" Link to comment Share on other sites More sharing options...
MadPotato Posted October 31, 2005 Share Posted October 31, 2005 i think i understood...maybe he is refering to str_replaceif you got:$string = "dupa dee doo";and usestr_replace("dupa","blergh",$string)you'll receive "blergh dee doo" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now