I need to remove all characters up to specific character in a string. I've searched in vain for a answer, so I hope you can help me.
It's to build a index/sitemap automatically
I have code that looks through specific directory's and outputs a list of contents:-
<li><a href="http://'path/to'.$filename.'">'.ucfirst($menuitem).'</a></li>
$filename = name_of_file.htm
$menuitem = name_of_file [.htm and '_' stripped]
My problem is the site is in two languages so ideally I'd like:-
<li><a href="http://'path/to'.$filename.'">'.ucfirst($menuitem).'<br />'.ucfirst($second_menuitem).'</a></li>
$filename = 'English_name~Spanish_name.htm'
$menuitem = 'English_name'
$second_menuitem = 'Spanish_name'
I've worked out how to strip everything after a the "~", but can't fathom how to strip everything before the "~"
Any help would be much appreciated.