You are here: Re: Accessing string arrays « PHP Programming Language « IT news, forums, messages
Re: Accessing string arrays

Posted by Jerry Stuckle on 09/28/47 12:01

Peter Pei wrote:
> "Giovanni" <blastingproton@gmail.com> wrote in message
> news:bfe96afe-98dc-4850-98a8-890b0de68daf@j20g2000hsi.googlegroups.com...
>> Hi! I've an array of string like this:
>>
>> $arraystring["name"]="John";
>> $arraystring["age"]="50";
>> $arraystring["work"]="teacher";
>>
>> $arraystring is global variable.
>>
>> I'm trying to code a function that get a string as parameter and print
>> the relative arraystring's value.
>>
>> function printArrayStr($key)
>> {
>> global $arraystring;
>> echo $arraystring["$key"];
>> }
>>
>> What do I wrong?! :(
>>
>> tnx, people!
>
>
> How amazing this is. His code worked with 5.2.5 for sure. Obviously
> none of the previous repliers cared to test his code, and went ahead
> with stupid answers any way.
>
> His code works 100% as long as he calls it the right way, for example
> printArrayStr("age"). Obviously he will get notice if he calls
> printArrayStr(age).
>
> make sure your answers is relevant, otherwise you are playing pure
> stupid.
> =============================================

(Top posting fixed)

At least the others didn't top post.

And no, I didn't test his code because he didn't post where the problem
is.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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