|
Posted by Janwillem Borleffs on 09/05/05 22:57
juglesh wrote:
> hello, i have a d/l'd class that gives an array which prints like
> this:
>
> stdClass Object
> (
>
This is not an array, but an object
> i cannot seem to access the values using
> $thearray['first name']['inputtype']
>
This works for arrays For objects, you should do this as follows:
$theobject->{'first name'}->inputtype;
Note that I used curly braces here because 'first name' contains a space
character.
If this wasn't the case, you could do it like this:
$theobject->firstname->inputtype;
> Here is the class, oh, and maybe someone can see why it's putting two
> end brackets on the [first name]], etc.
>
[...]
> // section
> if ((substr($data, 0, 1) == '[') AND (substr($data, -1) == ']')) {
> $this->_last_section = substr($data, 1, (strlen($data) - 1));
> return;
> }
>
$this->_last_section = substr($data, 1, - 1);
BTW, you should also take a look at the parse_ini_file function:
http://www.php.net/manual/en/function.parse-ini-file.php
JW
[Back to original message]
|