Solution:1
You’ll want to find the last occurrence of -
, using strrpos().
$output = substr( $number, 0, strrpos( $number, '-' ) );
Solution:1
You’ll want to find the last occurrence of -
, using strrpos().
$output = substr( $number, 0, strrpos( $number, '-' ) );
Solution:2
$part = substr($number,0,strrpos($number,"-"));