![]() |
|
#1
|
|||
|
|||
Just a couple questions.Hey, I'm brand new to PHP, but I have some C++ (slight), a lot of Flash's Actionscript, HTML, and BASIC behind me. PHP seems similar to a lot of other computer programming languages, but it's still quite a bit different.
If it's not too much trouble, I need help figuring out the PHP code to check a variable against an array from a file. I need to check a variable against an array for any duplicates of the variable, and if there is no duplicates, I need to add the variable's value to that array as the identifier being the variable getting checked, and the value as "Level 1." Adding the variable to the array is easy enough, though. I can picture the steps I'd need to take -- grab the array from the other file, check it against the variable, filter through them, find another similar one, break the cycle, return the variable with a new value of "Taken", or if no similar files exist, add it into the array -- but I don't know the code I'd need to use. I can put together parts of it, though. Assuming $arr is the array I grabbed from another file, and $variable is the variable I am checking against the Array. PHP Code:
So, is that right, at all? |
|||
|
#2
|
||||
|
||||
Re: Just a couple questions.Hello Philsco,
To answer your question, yes, it's right... BUT, there are other options you should / can consider. Like the in_array() function. PHP Code:
|
|
#3
|
|||
|
|||
Re: Just a couple questions.Oh, Hell yes. Thank you.
Now, I'm sorry to bring up further basic programming questions, but what would be the best way to post and retrieve this information? I've heard differing opinions between $_Post and $_Get, but they were both verbosely explained, and poorly, at that. |
|
#4
|
|||
|
|||
Re: Just a couple questions.Quote:
Post. GET encodes data in the URL, it is insecure, can be easily manipulated and there is a restriction on total length. |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A couple questions about Fl_Tabs | WW. | FLTK Forum | 3 | 07-Oct-2004 08:04 |
| Couple of questions Memory and CD RW | schuumi | Computer Hardware Forum | 3 | 15-Sep-2004 16:32 |
| Hello from cali, questions about web design | jonnydangerous | New Member Introductions | 3 | 20-Aug-2004 14:59 |
| Multi-Lingual Webpages & A Couple General Questions. | dwaunthomas | Web Design Forum | 5 | 15-May-2004 12:07 |
| Simple questions? | Netizen Dave | Apache Web Server Forum | 3 | 17-Mar-2004 05:45 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The