You are here: reading content of an array « All PHP « IT news, forums, messages
reading content of an array

Posted by nescio on 08/21/06 14:04

hello,

i have two array;

one is of the type:
$a = array('a','b','c','d');

i place this array in an associative array like:

$b = array('some_key' => 'hello ; ' . $a);

(so the value has some text then a ';' and then the array)

somewhere else in the script i must get the content of array $a from array
$b

i tried the following but it doesn't work.
i don't know why.

the result i get is:
hello
Array

but i want as a result:
hello
a
b
c
d

-------------- source code ---------------------
foreach($b as $k => $v){

$opdelen = explode(';',$v);

foreach($opdelen as $kk => $vv){
if(is_array($vv)){
/* it is an array: use a foreach to see the
content of it; */
foreach($vv as $key => $value){
echo $value . "<br>";
}
}else{
echo $vv . "<br>";
}
}


}

-------------------------------------------------

thanks

 

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

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