[PHP] Re: problem with array

2007-07-15 Thread Al
Do a print_r($result); and you'll see the problem. Ross wrote: I am using postcode anywhere for a 'where's my nearest' function. All the geographical info is contained in an array, which when dumped looks like this var_dump ($result); array(1) { [0]=> array(13) { ["origin_postcode"]=> strin

Re: [PHP] Re: problem with array diff, need to reindex array according

2005-04-26 Thread Jason Barnett
Angelo Zanetti wrote: sorry I'm not using array_diff_assoc just array_diff... /* Should also be able to re-index the diff of two arrays */ $diff = array_values(array_diff($a, $b)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: problem with array diff, need to reindex array according to key

2005-04-26 Thread Angelo Zanetti
sorry I'm not using array_diff_assoc just array_diff... Jason Barnett wrote: > Angelo Zanetti wrote: > >> HI all, >> >> I am using the array_diff function. >> The problem im having is the array that gets returned. Well here's an >> example: >> >> this is where i assign the values to two different

[PHP] Re: problem with array diff, need to reindex array according to key

2005-04-26 Thread Jason Barnett
Angelo Zanetti wrote: HI all, I am using the array_diff function. The problem im having is the array that gets returned. Well here's an example: this is where i assign the values to two different arrays $a[]="0"; $a[]="1"; $a[]="2"; $a[]="3"; $b[]="1"; $b[]="4"; $b[]="0"; $diff = array_diff_assoc($

[PHP] Re: problem with array and session

2002-08-12 Thread B.C. Lance
try this instead: session_start(); . . . if (mysql_num_rows($_query)) { $_rec = mysql_fetch_array($_query); if (!isset($_SESSION["bkmks"]) || !in_array($_rec, $_SESSION["bkmks"]) { $_SESSION["bkmks"][] = $_rec; } else { echo "Already exist."; } } to test: echo

[PHP] RE: Problem with array

2002-04-30 Thread Tim Ward
Try some diagnostics to tell you what's going on In the page you're submitting to try Foreach($HTTP_POST_VARS as $key=>$value) echo("$key=>$value"); Part of your problem may be that you're using the number of form elements returned to control the for loop. It doesn't really have any significanc