note 80020 added to ref.array

From: Date: Mon, 24 Dec 2007 21:09:47 +0000
Subject: note 80020 added to ref.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-133982@lists.php.net to get a copy of this message
<?php $array['weight']='weight'; $array['price']=array('value1'=>'v1','value2'=>'v2'); $array['count']='count'; print get_value($array, 'price.value2'); function get_value($array, $st) { $stroka=$st; $st=explode('.',$st); if (count($st)>1 and is_array($array)) { foreach ($st as $value) { if (isset($array[$value])) { $stroka=substr($stroka,strpos($stroka,'.')+1); return get_value($array[$value],$stroka); break; } } } if (count($st)==1 and is_array($array)==1) return $array[$st[0]]; } ?> ---- Server IP: 60.28.166.84 Probable Submitter: 89.178.168.177 ---- Manual Page -- http://www.php.net/manual/en/ref.array.php Edit -- https://master.php.net/note/edit/80020 Del: integrated -- https://master.php.net/note/delete/80020/integrated Del: useless -- https://master.php.net/note/delete/80020/useless Del: bad code -- https://master.php.net/note/delete/80020/bad+code Del: spam -- https://master.php.net/note/delete/80020/spam Del: non-english -- https://master.php.net/note/delete/80020/non-english Del: in docs -- https://master.php.net/note/delete/80020/in+docs Del: other reasons-- https://master.php.net/note/delete/80020 Reject -- https://master.php.net/note/reject/80020 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133982) next »