I have a test string which is something like this:
digit{digit}digit
I want to break this string into 3 variables. For example, 40{1}2
should be split into 40 1 2. The string could be as big as 2034{345}1245
. I assume regex would be the best way to split this string.
Here's what I have so far:
$productID = preg_match('/(.*?){/', $product);
$productOptionID = preg_match('/{(.*?)}/', $product);
$optionValueID = preg_match('/}(.*?)/', $product);