Say I have the following: "44-xkIolspO"
I want to return 2 variables:
$one = "44";
$two = "xkIolspO";
What would be the best way to do this?
Say I have the following: "44-xkIolspO"
I want to return 2 variables:
$one = "44";
$two = "xkIolspO";
What would be the best way to do this?
Try this:
list($one, $two) = split("-", "44-xkIolspO", 2);PHP has a function called preg_split() splits a string using a regular expression. This should do what you want.
Or explode() might be easier.