PHP coding help
Posted: Sat Feb 14, 2015 1:42 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 objective is to randomly select image when webpage opens.
***** Please use the PHP Code tag around source code *****
***** Please use the PHP Code tag around source code *****
Code: Select all
<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>