I have problem to split this variable. I just want the 1088
number.
http://ebook.com/php+in+100+days-1088.aspx
I've tried, but no luck, my code
print_r(preg_split("/[a-zA-Z]+-[0-9]+.aspx/", 'http://ebook.com/php+in+100+days-1088.aspx'));
preg_match( '/(\d+)\.aspx$/', 'http://ebook.com/php+in+100+days-1088.aspx', $matches );
$matches[1] gives you the 1088 number.
Not quite sure why the regex, but this one works for me:
$parts = preg_split("/(-|\.)/", 'http://ebook.com/php+in+100+days-1088.aspx');
echo $parts[2];