SlideShare une entreprise Scribd logo
1  sur  3
Please help me to correct my PHP programming assignment.
I'm trying to code, but there are some errors. Please help me to correct them.
QuestionThree: Write a PHP program that assigns 5 numbers to an array. It should then go
through the values in the array to find and display the minimum value stored in it.
Code:
<html>
<head>
<script type="text/javascript">
</script>
<style type="text/css">
</style>
</head>
<body>
<?php
//defining the function......
echo "even numbers between 0 to 100 is( ";
function evenNumbers() {
for ($1=2;$1<100;$1+=2)
{
echo $1."";
}
}
//callin the function......
evenNumbers() ;
?>
</body>
</html>
Note:
Parse error : syntax error, unexpected '1' (T_LNUMBER), expecting variable
(T_VARIABLE) or '{' or '$' in C:XampphtdocsQuestionThreeWeekTwo.php on line
13
Solution
Hi,
I have implemented as per your requirement. Pleaase find the below code.
Min.php
<html>
<head>
</head>
<body>
<?php
$num = array(4,5,3,1,2);
$arrlength = count($num);
$min = $num[0];
for($i = 0; $i < $arrlength; $i++) {
if($min > $num[$i]){
$min = $num[$i];
}
}
echo "The Minimum Value in an array is : ";
echo $min;
?>
</body>
</html>
Output:
The Minimum Value in an array is : 1
Please help me to correct my PHP programming assignment- I-'m trying t.docx

Contenu connexe

Similaire à Please help me to correct my PHP programming assignment- I-'m trying t.docx

Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
tutorialsruby
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
tutorialsruby
 

Similaire à Please help me to correct my PHP programming assignment- I-'m trying t.docx (20)

Web Technology_10.ppt
Web Technology_10.pptWeb Technology_10.ppt
Web Technology_10.ppt
 
PHP-Overview.ppt
PHP-Overview.pptPHP-Overview.ppt
PHP-Overview.ppt
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
PHP_Lecture.pdf
PHP_Lecture.pdfPHP_Lecture.pdf
PHP_Lecture.pdf
 
PHP-01-Overview.ppt
PHP-01-Overview.pptPHP-01-Overview.ppt
PHP-01-Overview.ppt
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and require
 
PHP
PHPPHP
PHP
 
Php Learning show
Php Learning showPhp Learning show
Php Learning show
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical Questions
 
Object Oriented PHP - PART-2
Object Oriented PHP - PART-2Object Oriented PHP - PART-2
Object Oriented PHP - PART-2
 
Php intro by sami kz
Php intro by sami kzPhp intro by sami kz
Php intro by sami kz
 
Php essentials
Php essentialsPhp essentials
Php essentials
 
Php 101 by David Menendez
Php 101 by David MenendezPhp 101 by David Menendez
Php 101 by David Menendez
 
Php
PhpPhp
Php
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
PHP 2.pptx
PHP 2.pptxPHP 2.pptx
PHP 2.pptx
 
Debugging PHP Code
Debugging PHP CodeDebugging PHP Code
Debugging PHP Code
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 

Plus de kdavid658

The mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docxThe mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docx
kdavid658
 
Please show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docxPlease show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docx
kdavid658
 
Please only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docxPlease only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docx
kdavid658
 
Please make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docxPlease make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docx
kdavid658
 

Plus de kdavid658 (16)

The mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docxThe mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docx
 
The primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docxThe primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docx
 
the primary function of the skin the primary function of the skin.docx
the primary function of the skin    the primary function of the skin.docxthe primary function of the skin    the primary function of the skin.docx
the primary function of the skin the primary function of the skin.docx
 
The primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docxThe primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docx
 
The pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docxThe pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docx
 
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docxThe nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
 
The main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docxThe main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docx
 
The left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docxThe left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docx
 
Please show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docxPlease show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docx
 
Please only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docxPlease only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docx
 
Please make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docxPlease make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docx
 
Please help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docxPlease help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docx
 
PLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docxPLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docx
 
please help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docxplease help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docx
 
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docxPlease help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
 
Please Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docxPlease Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docx
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Dernier (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Please help me to correct my PHP programming assignment- I-'m trying t.docx

  • 1. Please help me to correct my PHP programming assignment. I'm trying to code, but there are some errors. Please help me to correct them. QuestionThree: Write a PHP program that assigns 5 numbers to an array. It should then go through the values in the array to find and display the minimum value stored in it. Code: <html> <head> <script type="text/javascript"> </script> <style type="text/css"> </style> </head> <body> <?php //defining the function...... echo "even numbers between 0 to 100 is( "; function evenNumbers() { for ($1=2;$1<100;$1+=2) { echo $1.""; } } //callin the function...... evenNumbers() ; ?> </body> </html> Note: Parse error : syntax error, unexpected '1' (T_LNUMBER), expecting variable (T_VARIABLE) or '{' or '$' in C:XampphtdocsQuestionThreeWeekTwo.php on line 13
  • 2. Solution Hi, I have implemented as per your requirement. Pleaase find the below code. Min.php <html> <head> </head> <body> <?php $num = array(4,5,3,1,2); $arrlength = count($num); $min = $num[0]; for($i = 0; $i < $arrlength; $i++) { if($min > $num[$i]){ $min = $num[$i]; } } echo "The Minimum Value in an array is : "; echo $min; ?> </body> </html> Output: The Minimum Value in an array is : 1