I have a string that has been concatenated by the rows and columns that has be separated by using the special characters. Below is my code:
$strMaterialDetails = '13-"9"Strawberry%*DEALER%*15%*25%*375%*7.500%*7.500%*28.13%*2.000%*2.000%*6.94@^$14-"9" Yellow white Acrylic Long Pile Ext Roller Set%*DISTRIBUTOR%*45%*75%*3375%*2.500%*2.500%*84.38%*5.000%*5.000%*164.53@^$';
$pairs = explode('@^$', $strMaterialDetails);
foreach ($pairs as $pair) {
list($product, $store, $qty, $unit, $total_price, $discount, $discount_percen, $discount_value, $tax, $tax_percen, $tax_val) = explode('%*', $pair);
echo $store;
}
It works fine I have to insert the values into the database if I print the $store
it will print DEALERDISTRIBUTOR
I want to seperate this I don't know how to do. The string here entered is unknown.
Please give any suggestion.