|
Posted by Steve on 04/16/07 02:42
"Vince Morgan" <vinhar@REMOVEoptusnet.com.au> wrote in message
news:4621d472$0$16553$afc38c87@news.optusnet.com.au...
| "Francis S" <francissem@gmail.com> wrote in message
| news:1176601726.643587.69890@p77g2000hsh.googlegroups.com...
| > $record= array(
| > "product"=>array(
| > array("name"=>"apple","price"=>30.5),
| > array("name"=>"orange","price"=>20)
| > )
| > );
| >
| > echo array_read($record, "[product][0][price]") //out 30.5
| >
| > print_r (array_read($record, "[product][*][name]")) //out
| > array("apple","orange")
| >
| > echo array_read($record, "[product][*=>(name=orange)][price]") //out
| > 20
| >
| > echo array_read($record, "[product][(*)=>(price>20)][name]") //out
| > "apple"
| > echo array_read($record, "[product][(0)=>(name=orange)][price]") //out
| > null
| > echo array_read($record, "[product][(1)=>(name=orange)][price]") //out
| > 20
| >
| >
| >
|
http://pleiadesworks.blogspot.com/2007/04/query-array-easier-way-to-read-arrays.html
| >
| Is this one of those games where you offer the answer so someone can find
| the question?
BINGO !!!
btw, you are the winner! you win via answer proximity...'WTF is the problem'
was what trebec was expecting, however 'wtf is the question' is close
enough.
:)
Navigation:
[Reply to this message]
|