I want to cut a word in PHP but I only want the number. here is my word
$myword = BPT-11
I only want is 11
How can i do this? using split
or substr
You can use explode.
$myword = "BPT-11";
$exploded = explode("-", $myword);
echo $exploded[1];
//return 11
Reference: