How to split hash key and value without using "foreach"
Posted 02 August 2006 - 06:08 PM
Given the following:
$array['keyval'] = "some data";
Is there a shorter way of coding this expression:
$val = $array['keyval'] ? $array['keyval'] : 'keyval';
The above may seem quite short already, but my code uses some rather long 'keyval' strings, eg:
$val = $array['this is a rather long string...'] ? $array['this is a rather long string...'] : 'this is a rather long string...';
In other words, without using "foreach ($array as $key => $val)", I want to get at the $key string of a hash.
Posted 02 August 2006 - 07:43 PM
Posted 02 August 2006 - 07:51 PM
or [php] * 1000... PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users