|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
for loop in an array
I need to do the following any ideas:
PHP Code:
__________________
regards, Fulton |
|
#2
|
|||
|
|||
|
I am not seeing what it is you are trying to do here. It looks like you want to get information from $day_of_event which may be an associative array using the $day_array value as an index... is this close?
I also do not see where your for loop comes into play and where you would need to use the $i variables. Why is it looping up to 10? Maybe you need a foreach to iterate an associative array? |
|
#3
|
|||
|
|||
|
Sorry my previous post was really bad, here is what i am trying to do, but without success:
PHP Code:
Any ideas?? |
|
#4
|
||||
|
||||
|
I dont understand why you're making the array...
why not just do this: $test = "index.php?id=$id"; although if you insist on the array... try this: $test = array('index.php?id='. $id,'linked'); if that fails, try $test[] = ... |
|
#5
|
|||
|
|||
|
I need to create a list of arrays, which will then be put into another array.
i.e. PHP Code:
does that make better sense. |
|
#6
|
||||
|
||||
|
I'm pretty sure this syntax here will cause an error:
$id=>array(stuff) try simply taking the $id=> out and just doing array(stuff) |
|
#7
|
|||
|
|||
|
it needs to be like this as the function requires it
$id=>array('index.php?id='. $id,'linked') This is how it looks PHP Code:
but i want to get the day values from a database. |
|
#8
|
|||
|
|||
|
Use this function :
$array = array(); array_push ( $array, "STUFF, here it can be a sub-array too" ); Convert your code to use this function.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > for loop in an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|