holyearth Posted December 11, 2006 Share Posted December 11, 2006 Let's say that $information = $broughtinand that$broughtin = 'Cat jumps very high'If I print $information I want it to remove the word "very"So it should print:Cat jumps highHow can I tell it to remove a certain word (in this case "very")?Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/30268-solved-removing-a-word-from-a-string/ Share on other sites More sharing options...
utexas_pjm Posted December 11, 2006 Share Posted December 11, 2006 [code]$cleanString = str_replace('very', '', $string); [/code] Link to comment https://forums.phpfreaks.com/topic/30268-solved-removing-a-word-from-a-string/#findComment-139234 Share on other sites More sharing options...
holyearth Posted December 11, 2006 Author Share Posted December 11, 2006 Thanks utexasI appreciate your help.This board rocks! Link to comment https://forums.phpfreaks.com/topic/30268-solved-removing-a-word-from-a-string/#findComment-139236 Share on other sites More sharing options...
craygo Posted December 11, 2006 Share Posted December 11, 2006 Use str_replace[code]$text = "Cat jumps very high";$new = str_replace("very", "", $text);echo $new;[/code]Ray Link to comment https://forums.phpfreaks.com/topic/30268-solved-removing-a-word-from-a-string/#findComment-139237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.