Jump to content


Photo

PHP coding help


  • Please log in to reply
No replies to this topic

#1 tarnold4

tarnold4

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 14 February 2015 - 02:31 PM

Im very new to php, I wanted to see if anyone could help me with the following. I have to take a function, along with the count function, to randomly select one of the array values. Use the return keyword to return this value and end the function. The value returned should be one of the provided file names. The whole thing is to randomly select an image, when webpage is loaded

<html>
  <head>
  <title>JFQ Turnings</title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
  <img src="jfqturnings.gif" alt="JFQ Turnings, coming soon." width="864" height="100">
  <br /><img src="table.jpg" alt="" width="864" height="567">
  <?php>
  function random image(){
 	$images = array("candlestick.jpg", "rollingpin.jpg", "table.jpg", "table2.jpg");
     $random = rand(0, 3);
 	
 }
 ?>
 </body>
 </html>
 <?php





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users