SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

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
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Kürzlich hochgeladen (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
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Ữ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
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
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

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