I have a variable that looks like this
$result="10:S MW/20:DHTS/10:D HCS/60:HH DC";
(it is retreived from a MySQL table(VarChar))
I want to make in into an PHP array so that looks like this
"10:S MW","20😃HTS","10😃 HCS","60:HH DC"
Here is the deal..
I have a PAGE.PHP that gets that $result, seperates it by slash and displays them on the screen as links..
I want to be able to remove that portion of the string by clicking on the approriate link..
$V = EXPLODE("/",$result);
$Count = count($V);
$X = 0;
while ($X < $Count) {
echo "<a href='delete.php?D=".$V[$X].">".$V[$X]."</A><BR>";
$X = $X+1;
}
When the link is clicked, and delete.php is loaded it
does a GET_PARAM("D") to see which one I need to delete
the entire original $result is still there also
How to I get $D out of $array so I can update the MySQL table with $NewArray?
like if they clicked on one that says 20😃HTS I want the NewArray to be stored in a variable like this:
$NewArray="10:S MW/10:D HCS/60:HH DC";
so I can do this:
$Query="UPDATE Table_Name SET Field_Name = '".$NewArray."' WHERE ID='".$ID."' ";
Any Suggestions?
Thanx,
Mystic
by the way, I have spent the past 3 hours trying everything from ARRAY_DIFF() to str_replace()
(I went to PHP.NET and after playing with several things, just decided to try all the commands that looked like they might work..
I think they didnt becasue my $result is not a 'propor' array even though I tried EXPLODE and then did $VALUE=Array($result)..which didnt work either.. )