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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.