[mapping] => Array
(
[0] => PO1/KPP1
[1] => PO2/KPP2
[2] => PO3/KPP3
[3] => PO4/KPP4
[4] => PO5/KPP5
[5] => PO6/KPP6
[6] => PO7/KPP7
)
<?php
$str = "PO1/KPP1";
$strarr = split ("/", $str);
print "$strarr[0] <br />";
print "$strarr[1] <br />" ;
?>
i have a data that's i declare like this PO1/KPP1. i want to save PO1 into 1 field and KPP1 into other field. both are in the sama table.
i know the logic..but i don't know how to interpret into programming.
can i nobody help me.
use http://php.net/manual/en/function.explode.phpn to explode data.
foreach ($mapping as $value) {
$pieces = explode("/", $value);
$dataA = pieces[0];
$dataB = pieces[1];
//save data...
}