May 25, 2007 #1 hunt00 Technical User Mar 6, 2005 79 US I have the string $orig. Could someone help me to remove all the brackets and strings inside the brackets? The result will look like $final. $orig = "text1<something>text2<others>text3"; $final = "text1text2text3"; Thanks very much!
I have the string $orig. Could someone help me to remove all the brackets and strings inside the brackets? The result will look like $final. $orig = "text1<something>text2<others>text3"; $final = "text1text2text3"; Thanks very much!
May 25, 2007 #2 jpadie Technical User Nov 24, 2003 10,094 FR Code: $pattern = '/<.*?>/i'; $final = preg_replace($pattern, '', $orig); or, not using regex (and the manual recommends not using regular expressions when there is an alternative) Code: $final = strip_tags($orig); Upvote 0 Downvote
Code: $pattern = '/<.*?>/i'; $final = preg_replace($pattern, '', $orig); or, not using regex (and the manual recommends not using regular expressions when there is an alternative) Code: $final = strip_tags($orig);
May 29, 2007 Thread starter #3 hunt00 Technical User Mar 6, 2005 79 US Thanks greatly! It works very well! Upvote 0 Downvote
May 31, 2007 #4 BillyRayPreachersSon Programmer Dec 8, 2003 17,047 GB hunt00, Perhaps you could give some closure on this thread? thread216-1363257 Dan Coedit Limited - Delivering standards compliant, accessible web solutions [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt] Upvote 0 Downvote
hunt00, Perhaps you could give some closure on this thread? thread216-1363257 Dan Coedit Limited - Delivering standards compliant, accessible web solutions [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt]