array query | |
$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/20...ad-arrays.html | | | | re: array query
Francis S wrote: Quote:
$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/20...ad-arrays.html
>
array_read() is not in my PHP manual. I don't really see the points you
are trying to make here or on your blog. You're surely not just spamming
for attention?
Sh. | | | | re: array query
"Francis S" <francissem@gmail.comwrote in message
news:1176601726.643587.69890@p77g2000hsh.googlegro ups.com... Quote:
$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/20...ad-arrays.htmlIs this one of those games where you offer the answer so someone can find
the question? | | | | re: array query
On Apr 15, 1:22 pm, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
wrote: Quote:
Francis S wrote: Quote:
$record= array(
"product"=>array(
array("name"=>"apple","price"=>30.5),
array("name"=>"orange","price"=>20)
)
);
> Quote:
echo array_read($record, "[product][0][price]") //out 30.5
> Quote:
print_r (array_read($record, "[product][*][name]")) //out
array("apple","orange")
> Quote:
echo array_read($record, "[product][*=>(name=orange)][price]") //out
20
> Quote:
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
> >
array_read() is not in my PHP manual. I don't really see the points you
are trying to make here or on your blog. You're surely not just spamming
for attention?
>
Sh.
just an idea without using foreach.. . maybe someone can proposals a
better one | | | | re: array query
On Apr 15, 7:38 am, "Francis S" <francis...@gmail.comwrote: Quote:
>
just an idea without using foreach.. . maybe someone can proposals a
better one
Yeah -- use DOM and XPath. | | | | re: array query
Francis S wrote: Quote:
$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/20...ad-arrays.html
>
Seems to be a solution to a non-existent problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | | | | re: array query
Francis S wrote: Quote:
On Apr 15, 1:22 pm, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
wrote: Quote:
>Francis S wrote: Quote:
>>$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/20...asier-way-to-r...
>array_read() is not in my PHP manual. I don't really see the points you
>are trying to make here or on your blog. You're surely not just spamming
>for attention?
>>
>Sh.
>
just an idea without using foreach.. . maybe someone can proposals a
better one
>
And what does array_read() look like in that case? To be honest I had
the same feeling Jerry had, I don't really see a realistic problem being
solved, but I kind'a hoped the magic would be in your array_read(). But
after rereading I still don't see an implementation.
But then I've been known to make a fool of myself more than once, so I'm
here with two leges ready for pulling. Surprise me!
Sh. | | | | re: array query
"Vince Morgan" <vinhar@REMOVEoptusnet.com.auwrote in message
news:4621d472$0$16553$afc38c87@news.optusnet.com.a u...
| "Francis S" <francissem@gmail.comwrote in message
| news:1176601726.643587.69890@p77g2000hsh.googlegro ups.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/20...ad-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.
:) |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,501 network members.
|