Welcome Guest, Not a member yet? Register   Sign In
Array helper :: element()
#1

[eluser]Bondie[/eluser]
Say my array is something similar too:

Code:
$array = array('code' => array('html' => '<code></code>', 'bbcode' => '[code][\/code]'),
'php' => array('html' => '<span class="php"></span>', 'bbcode' => '[php][/php]')
);

obviously thats not going to work as its not valid blah blah, my question is using element() can i get an element of an element...?
I can obviously get the first element using:
Code:
$php = element('php',$array');

How would i get the second element??? :\
Code:
$bbcode = element('bbcode',$php)

would that work??

From the manual example usage:
Code:
$array = array('color' => 'red', 'shape' => 'round', 'size' => '');

// returns "red"
echo element('color', $array);

// returns NULL
echo element('size', $array, NULL);


Messages In This Thread
Array helper :: element() - by El Forum - 10-01-2009, 10:12 AM
Array helper :: element() - by El Forum - 10-01-2009, 10:17 AM
Array helper :: element() - by El Forum - 10-01-2009, 10:20 AM
Array helper :: element() - by El Forum - 10-01-2009, 10:29 AM
Array helper :: element() - by El Forum - 10-01-2009, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB