I have a string like this : x320h220
I want to split this string into two variables : $width and $height
I Can split it using explode but I have to use this method twice to get these values so I found out preg_split will do the trick. But I don't know the Regex to split these string into two variables (find if string contain x then cut the rest till h and then cut the rest again in another variable) which they should be like :
$width = 320;
$height = 220;
any suggestion ?