Contact: aviboots(AT)netvision.net.il
40,764 questions
53,140 answers
573 users
$s = 'PHP is a general-purpose scripting language [sub]suited to web[/sub] development.'; preg_match_all("~\[sub\](.*?)\[\/sub\]~",$s, $subs); print_r($subs[1]); echo $subs[1][0]; /* run: Array ( [0] => suited to web ) suited to web */
$s = 'PHP is a general-purpose scripting [language] suited to web [/development].'; preg_match_all("~\[language\](.*?)\[\/development\]~",$s, $subs); print_r($subs[1]); echo trim($subs[1][0]); /* run: Array ( [0] => suited to web ) suited to web */