I have a variable called $name and it contains something like this:
$name = 'FName_LName_DataX_Number_www.website.com';
I want to put all the data before the Number in an array withouth the underscores and the Number value too.
Something like this:
$array[0] = 'Fname Lname DataX';
$array[1] = 'Number';
$name examples:
$name = 'Roberto_Carlos_01_www.website.com';
$name = 'TV_Show_Name_785_www.website.com';
Your problem is special to use regular expressions. But at any time that someone gives that kind of solution another someone say
regular expressions are evil!. So let’s play a little: