You are here: RE: [PHP] a basic array question! « PHP « IT news, forums, messages
RE: [PHP] a basic array question!

Posted by "Robbert van Andel" on 06/26/05 00:46

If you want to get the lastname value of the array you supplied you would do
this

$value = $foo['facets'][0]['lastname'];

This would give you the HTML form that you have stored in your array.

Robbert

-----Original Message-----
From: bruce [mailto:bedouglas@earthlink.net]
Sent: Saturday, June 25, 2005 2:02 PM
To: php-general@lists.php.net
Subject: [PHP] a basic array question!

feel kind of foolish posting this.. but i can't seem to figure it out for
now..

i have an array, i can do a print_r($foo) and get the following:
Array
(
[bookmark] => 1
[facets] => Array
(
[0] => Array
(
[lastname] => <form id="facet-lastname">
<input type="hidden" name="list" value="" />
<input type="hidden" name="offset" value="0" />
<input type="hidden" name="orderBy" value="username" />
<input type="hidden" name="sort" value="asc" />
<strong>Name:</strong>
<input type="text" name="_lastname" value="" style="width: 125px" />
<input type="submit" value="Search" />
</form>
}

i simply need to know how to get the actual value of an element ('lastname')
to do:
$cat = $foo->facets[0]->['lastname'] (obviously, this doesn't work!!)

i've tried a variety of possible choices, with no luck...

any ideas/thoughts/etc...

thanks

bruce
bedouglas@earthlink.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация