![]() Topic awaiting preservation: PHP explode/implode (Page 1 of 1) |
|
|---|---|
|
Paranoid (IV) Inmate From: Kansas City, MO , USA |
posted 01-10-2011 22:17
Maybe I just haven slept for awhile... But for the life of me, I can't figure out this problem... |
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 01-10-2011 22:46
code: $new = array();
foreach (explode($old) as $keyvalue)
{
$temp = explode($keyvalue, ":");
if ($temp[0] == $_POST['cond'])
$temp[1] += int($_POST['qty']);
$new[] = $temp[0] . ':' . $temp[1];
}
$new = implode($new, " ");
|