PJsus Posted March 8, 2018 Share Posted March 8, 2018 PHP problem I dont manage to solve. Given the number range: 1,4,8,1,4,10,5,6,2,4,6. Create an array for this range of numbers. Then use this array to: 1. Print all numbers that are over 5. 2. Record how many numbers are over 5 and show this. 3. List the numbers backwards. 4. Find the smallest number by a loop. Then write the number. 5. Find the smallest number by a PHP function. Then write the number. 6. Then create custom functions with an input parameter for task 1) and 2). The input parameter shall enter the number to be tested in the tasks. The features should return values . Regards Link to comment Share on other sites More sharing options...
cyberRobot Posted March 8, 2018 Share Posted March 8, 2018 What have you tried? Where are you stuck? Link to comment Share on other sites More sharing options...
PJsus Posted March 8, 2018 Author Share Posted March 8, 2018 dont know where to start Link to comment Share on other sites More sharing options...
cyberRobot Posted March 8, 2018 Share Posted March 8, 2018 Are you familiar with arrays? How about loops? There's a quick example of creating an array and looping through the values here: http://php.net/manual/en/control-structures.foreach.php Link to comment Share on other sites More sharing options...
ginerjm Posted March 8, 2018 Share Posted March 8, 2018 What school project is this for? Link to comment Share on other sites More sharing options...
Phi11W Posted March 9, 2018 Share Posted March 9, 2018 PHP problem I dont manage to solve. Given the number range: 1,4,8,1,4,10,5,6,2,4,6. Create an array for this range of numbers. Then use this array to: 1. Print all numbers that are over 5. 2. Record how many numbers are over 5 and show this. 3. List the numbers backwards. 4. Find the smallest number by a loop. Then write the number. 5. Find the smallest number by a PHP function. Then write the number. 6. Then create custom functions with an input parameter for task 1) and 2). The input parameter shall enter the number to be tested in the tasks. The features should return values . Regards You could do worse than start by reading some bits of the Manual: Arrays: array Looping: for or foreach Conditions: if Regards, Phill W. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.