I have this string:
"$string="Med0x2"
What I want, is to separate it into two strings, like this:
$string1="Med0x" ; $string2="2";
And then convert $string2
into an int variable (covert from string to int)
How do I do this?
I have this string:
"$string="Med0x2"
What I want, is to separate it into two strings, like this:
$string1="Med0x" ; $string2="2";
And then convert $string2
into an int variable (covert from string to int)
How do I do this?
$string = "Med0x2";
$string1 = substr($string, 0, 5);
$string2 = substr($string, 5);
$integer = (int) $string2;