![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing array elements | mansa | Shell Programming and Scripting | 1 | 10-30-2008 06:28 AM |
| Deleting Array Elements | msb65 | UNIX for Dummies Questions & Answers | 3 | 10-21-2008 03:29 PM |
| compare a variable against array elements | fearboy | Shell Programming and Scripting | 2 | 06-27-2008 06:45 PM |
| Rearrange array elements-Pls help | tj23 | Shell Programming and Scripting | 4 | 06-20-2008 10:29 AM |
| To return the elements of array | Sudhakar333 | Shell Programming and Scripting | 5 | 08-06-2007 03:20 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
PHP arrays as array elements
PHP question...I posted this on the Web Programming forum, but maybe this is a better place!
I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names. So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person with values "Fred", "Bert", "Tom" etc So what I want to do is display the $col value but the person's name, not the id... ie $person[$col[1]] should display "Fred" $person[$col[3]] should display "Tom" etc However, this doesn't want to parse correctly and I get errors, with or without quotes. I've verified that $col[1] is 1 and $person[1] is "Fred", for example. What syntax is required? Any help appreciated. Jerry |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|