![]() |
|
#1
|
|||
|
|||
Basic PHP For Loop HelpHi Guys,
I have a general enquiry about PHP syntax. I'm having trouble creating a VERY simple for loop using PHP, i think the best way to explain this is by an example: say if i want to create a loop which changes the values of different variables of incrementing names at every loop, how would i do this: $date1 = sunday $date2 = monday $date3 = tuesday ... $date7 = saturday for ($i=1; $i<8; $i++) { $date.$i==1; } the above code doesnt work, i hope you guys can see what im trying to do here. trying to amend $date1 == 1, then $date2 == 1... $date7== 1. What should be the correct code for $date.$i==1? Thanks, - Justin |
|
#2
|
||||
|
||||
|
Hello justinhn,
I'll be honest - I really don't understand what you're asking. However, I would suggest you use an array for something like this... for example: PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help ! I need help starting up on Php ! | onauc | MySQL / PHP Forum | 11 | 04-Jan-2005 23:57 |
| uisng php to display php | dopee | MySQL / PHP Forum | 6 | 14-May-2004 18:40 |
| php software | dopee | MySQL / PHP Forum | 0 | 04-May-2004 11:26 |
| [Linux] Installing PHP --with-mcrypt | JdS | Web Hosting Forum | 0 | 20-Aug-2003 08:40 |
| All the big PHP script collections that matter | jrobbio | MySQL / PHP Forum | 5 | 06-Jun-2003 16:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The