look at these codes plz $a = array('aw' => 'buw', 'bw' => 'dsf'); $b = "['aw']"; echo $a.$b; Code (markup): i wanted the result buw for that but its showing Array['aw'] i know if i use $a['aw'] it will work, but for some reason i need to do it such way tnx in advance
You can use echo $a[$b]; this will work. The way your doing is used for string concatenation not for array mapping.
why ppl do not read fully b4 reply !!! btw, @b.krishna: not working man! actually my variable will be like this: $var['som']['data']['link'] the array $var will be created in the php file. but ['som']['data']['link'] is stored in mysql db. so i wanted to get it maybe in variable $b....so it will be $b = ['som']['data']['link'] thats why i tried like that ($var.$b) to show the array's value
You need to step back and explain what you are trying to do rather than trying to come up with a solution yourself and forcing us to get that to work for you. It is more than likely that as a collective we will be able to come up with a better solution to your overall problem.
$a = array('aw' => 'buw', 'bw' => 'dsf'); $b = "['aw']"; eval('echo $a'.$b.';'); //OR this if you want to save the result eval('$c = $a'.$b.';'); echo $c; PHP:
@ShadyStudent: i told that on my 2nd post...i gave full array @emed: yo...it works. tnx man. thank you very much