How can I loop through the members of an array?
Answer / jude jeevanraj.p
If you want to create a quick and easy loop to show the
values of an array, then all you need is the trusty foreach
control structure, thus:
<?php
$alphabet = range("A","Z");
foreach
| Is This Answer Correct ? | 2 Yes | 2 No |
How to concatenate two strings in php?
Does php has a future?
How to set session.gc_maxlifetime properly?
How to remove an empty directory?
How many ways you can delete a session variable ?
Is php an oop?
What are Sub routines?
<?php include ("db.php"); $result = mysql_query("SELECT ques_id FROM questionbank order by ques_id limit 5 "); while($obj=mysql_fetch_array($result)) { $ad1[$obj['ques_id']]++;//Used an array and inserted the database query results into it. } $rand_keys=array_rand($ad1,1); //Did a random array function echo "First random id = ".$ad1[$rand_keys[0]]; echo "<br>Second random id = ".$ad1[$rand_keys[1]]; ?> <!--Its not working. Have any solution for this. -->
What is php and sql?
What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
Whhat is a Functions
display selected value in dropdown list through javascript without page refresh