
printJimy
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by printJimy
-
learn first , then works
-
why not to be used , they are simple 2 digits ?
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
I do not say to leave forum , Now I understood the issue , and i thought not to use a " for " in these situations , not forever(even i said ). I am here to learn, not to oppose .- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
ok ok, I will not use never again "for or while" . Thank to all of you , topic can be closed .- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
this is what appears to me , the only thing that I changed is that i add an <br> inside of for loop like this: for($q = 1; $q <= $questions; $q++){//loop through number of questions required echo " <input name='questions[]' type='text' value='question $q' /><br/>\n"; for($opt = 1; $opt <= $choices; $opt++){//loop through number of options required echo " <input name='choice[]' type='text' value='option $opt' /><br/>\n"; } [color=#ff0000] //here [/color] [color=#ff0000] echo "<br>";[/color] }
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
Ok , i said that im just learning how to use other loop in these case , but i do not use" for or while" when i work with array , because i know that foreach is constructed for that. So i just want to know how to use other loop to manipulate with array.- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
i know with foreach , foreach ($vegetables as $k => $v) { echo $k; } , but i want with "for" .- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
also i have a question about how to output the key of array with the for loop . example this is an array and this array have 2 key 1 and 2 , how to output these keys . $vegetables=array (1=>"apples", 2=>"pear"); and the output of this array i like to be (if it is possible) : 1 apples 2 pear without any special function like key(); or something like this . Thanks- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
I'm just learning how to use" for or while" in these situations . again , thank you too much.- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
How To Output Multidimensional Array , With For Loop ?
printJimy replied to printJimy's topic in PHP Coding Help
Thank to all of you , i really understood issue now . Also when we have the key of array as a string , we need to use a string also in a loop , example like this ? is it the right ? <?php $mArr = array( "a"=>array(1, "string", 3, 4, 5), "b"=>array(7, 20, 43, 44, 25) ); for ($i="a"; $i<= "b"; $i++) { for ($j=0;$j<count($mArr[$i]); $j++) { echo $mArr[$i][$j]." "; } echo"<br>"; } ?>- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)
-
Hello . ( explain me plz)How can i output an Multidimensional array with for loop(or while), not with foreach ? example this array $exampleMultidmArr = array ( "nested1" =>array (1,2,3,4,5), "nested2" =>array (7,20,43,44,25), ); Thank You.
- 23 replies
-
- multidimensional arrayphp
- for loop
- (and 1 more)