Jump to content

PHP arrays and lists, assignmenthelp


PJsus

Recommended Posts

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

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.