output of form:
Array (
[0] => (19.979802102871425,73.78671169281006)
[1] => (19.97978382724978,73.78682289971039)
[2] => (19.979765551626006,73.78697712672874)
)
expect output:
Array (
[0] =>
[lag]=>19.979802102871425,
[long]=>73.78671169281006,
[1] => [lag]=>19.97978382724978,
[long]=>73.78682289971039
[2] => [lag]=>19.979765551626006,
[long]=>73.78697712672874
)
following code working is not given me desired output as i am unaware of adding two associate element in array
foreach($_POST['textbox'] as $value):
$value = str_replace(array('(',')'), '',$value);
foreach (explode(',', $value) as $topic) :
list($name, $items) =$topic;
///stuck up here
}
$test[] = explode(',', $value);
endforeach;
endforeach;
could please suggest the changes in the code as i reffered following links but the expected out is different from mine.thanks in advance php-explode-and-put-into-array explode-function