I need to pull out a number from a variable that I know is going to have a number between a "-" and ".php" and I need to extract that number. There could be numbers or other "-" in the string. I am extracting "-9890.php" using the code I have below, but I need to extract "9890" or whatever number falls between the "-" and ".php". Can anyone help me out?
<?php
$filepath = "dkdkdkddd09090aeef-9890.php";
$filename = ereg("-[0-9]*.php$",$filepath, $number);
echo $number[0];
?>