Re: [PHP] Access Array Values?
I knew there was areason why I stopped Perling :) THANKS! How do I disassemble its values? How would I foreach? Something like this? foreach (array_count_values ($names) as $name and $count) -?? { echoa href=\search.php?input=.$name.\.$name./a (.$count.)br`; } a href=search.php?input=billbill/a (3)br a href=search.php?input=johnjohn/a (3)br a href=search.php?input=marymary/a (4)br http://www.php.net/manual/en/function.array-count-values.php talks about how it counts. But how do I access each separate value? John --snip--- $names = array (john, mary, bill, mary, bill, mary, bill, john, bill, john); echopre; print_r($names); echo/pre; echohrpre; print_r(array_count_values ($names)); echo/pre; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Access Array Values?
foreach (array_count_values ($names) as $name=$count) -^^ -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Access Array Values? I knew there was areason why I stopped Perling :) THANKS! How do I disassemble its values? How would I foreach? Something like this? foreach (array_count_values ($names) as $name and $count) -?? { echoa href=\search.php?input=.$name.\.$name./a (.$count.)br`; } a href=search.php?input=billbill/a (3)br a href=search.php?input=johnjohn/a (3)br a href=search.php?input=marymary/a (4)br http://www.php.net/manual/en/function.array-count-values.php talks about how it counts. But how do I access each separate value? John --snip--- $names = array (john, mary, bill, mary, bill, mary, bill, john, bill, john); echopre; print_r($names); echo/pre; echohrpre; print_r(array_count_values ($names)); echo/pre; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access Array Values?
:) foreach (array_count_values ($names) as $name=$count) Thanks M! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php