hi friends now iam having a string $string="i am a boy"; if i pass $remove="boy" means it should remove boy from $string and it should display $string="i am a" now if i do echo $string means it should print i am a or like that if i pass $remove="i" means it should remove i from $string and it should display $string="am a boy" can any body help me in php
It looks like you should go to google.com and type in 'php tutorial' and do some reading. But to answer your question, if you have a string: $string="i am a boy"; and: $remove="boy"; Then you will have two strings: $string will be "i am a boy" $remove will be "boy" If you want to remove "boy" from inside of the string $string you can do this: $string = str_replace('boy', '', $string); PHP: