Forum Moderators: coopster

Message Too Old, No Replies

arrays

text variable

         

WhosAWhata

10:57 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



is it possible to have an array (or the equivalent) that allows you to say like $text['hi']; or $text['this'];?

mykel79

11:01 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



If you're asking whether the key in an array can be a string, then the answer is yes.
Just try it out yourself! :)

$var1['somestring']='aaa';
echo $var1['somestring'];

WhosAWhata

11:22 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



thanks

ergophobe

6:35 pm on Mar 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This will help

[us2.php.net...]

charlier

6:53 pm on Mar 28, 2004 (gmt 0)

10+ Year Member



You can even use them in form variables like
<input type=submit value='ALL - TEXT' name='FormAction[book_search::dosearch--NEW-CDEFAULT-ALL]'> \n";

then you can extract the key of your form variable and use it to select a class and function and pass it some parameters all without affecting whats written on your button.