Learn Basic PHP Programming
Contents
-----
Flow Chart:
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. PRINT "Hello World"
3. END
-----
PHP Language sample code:
helloworld.php
|
<?php
echo “Hello World”;
?>
|
-----
Flow Chart:
----
Pseudo Code:
Pseudo Code:
1. BEGIN
2. PRINT 1 + 2
3. END
-----
PHP Language sample code:
sumnumbers.php
|
<?php
echo 1+2;
?>
|
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
Pseudo Code:
1. BEGIN
2. INPUT var1, var2
3. PRINT var1+var2
4. END
-----
PHP Language sample code:
sumvariables.php
|
<?php
//assume user input 1,2
$var1=1;
$var2=2;
echo $var1+$var2;
?>
|
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. INPUT var1, var2
3. PRINT var1 x var2
4. END
-----
PHP Language sample code:
multiplyvariables.php
|
<?php
//assume user input 1,2
$var1=1;
$var2=2;
echo $var1*$var2;
?>
|
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. INPUT var1, var2
3. IF var2=0
4. THEN PRINT "Error. Division by zero."
5. ELSE PRINT var1/var2
6. END
-----
PHP Language sample code:
dividevariables.php
|
<?php
//assume input 1,0
$var1=1;
$var2=0;
if ($var2==0)
{ echo "Error. Division by zero.";}
else
{ echo $var1/$var2;}
?>
|
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. PRINT "Start counting."
3. FOR i LOOP := 1 to 3
4. PRINT i
5. END LOOP
6. PRINT "Done."
7. END
-----
PHP Language sample code:
Note: PHP array index number starts with 0.
countnumbers.php
|
<?php
echo "Start counting."."<br/>";
for ($x=0; $x<3; $x++) {
echo $x."<br/>";
}
echo "Counting done."."<br/>";
?>
|
-----
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. INITIALIZE ARRAY arr[5] TO CONTAIN VALUES 1,2,3,4,5
3. PRINT "Displaying array values."
4. FOR i := 1 to 5
5. PRINT arr[i]
6. END FOR LOOP
7. PRINT "Done."
8. END
-----
PHP Language sample code:
displayarrayvalues.php
|
<?php
$arr=array("1","2","3","4","5");
echo "Display array values"."<br/>";
for ($x=0; $x<5; $x++) {
echo $arr[$x]."<br/>";
}
echo "Done"."<br/>";
?>
|
-----
-----
PHP Language sample output:
-----
Note:
This tutorial demonstrates the steps to edit an array value. The program displays the array values before and after the edit is done. There are code redundancies here. Ignore this for now.
Note:
This tutorial demonstrates the steps to edit an array value. The program displays the array values before and after the edit is done. There are code redundancies here. Ignore this for now.
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN
2. INITIALIZE ARRAY arr[i] WITH VALUES 1,2,3,4,5
3. FOR i := 1 to 5
4. PRINT arr[i]
5. END FOR LOOP
6. INPUT indexnumber
7. INPUT arrayvalue
8. arr[indexnumber] = arrayvalue
9. FOR i := 1 to 5
10. PRINT arr[i]
11. END FOR LOOP
12. END
-----
PHP Language sample code:
editarrayvalues.php
|
<?php
$arr=array(1,2,3,4,5);
echo "Display array values"."<br/>";
for ($x=0; $x<5; $x++) {
echo $arr[$x]."<br/>";
}
echo "Done"."<br/>";
$indexnumber=0;
$arrayvalue=2;
$arr[$indexnumber]=$arrayvalue;
echo "Display array values"."<br/>";
for ($x=0; $x<5; $x++) {
echo $arr[$x]."<br/>";
}
echo "Done"."<br/>";
?>
|
-----
-----
PHP Language sample output:
-----
Flow Chart:
-----
Pseudo Code:
1. BEGIN displaydata
2. FOR all item in array PRINT item values
3. END displaydata
1. BEGIN displaydata
2. FOR all item in array PRINT item values
3. END displaydata
1. BEGIN updatedata
2. INPUT indexnumber, arrayvalue
3. arr[indexnumber]=arrayvalue
2. INPUT indexnumber, arrayvalue
3. arr[indexnumber]=arrayvalue
4. END updatedata
1. BEGIN main
2. CALL displaydata
3. CALL updatedata
4. CALL displaydata
5. END main
2. CALL displaydata
3. CALL updatedata
4. CALL displaydata
5. END main
-----
PHP Language sample code:
Note: We use parameter passing here; passing by value=$arr and passing by reference=&$arr
modularprogram.php
|
<?php
$arr=array(1,2,3,4,5);
function displayData($arr){
echo "Display array values"."<br/>";
for ($x=0; $x<5; $x++) {
echo $arr[$x]."<br/>";
}
echo "Done"."<br/>";
}
function updateData(&$arr){
echo "Updating Data..."."<br/>";
$indexnumber=0;
$arrayvalue=2;
$arr[$indexnumber]=$arrayvalue;
}
displayData($arr);
updateData($arr);
displayData($arr);
?>
|
-----
-----
PHP Language sample output:
nice blog.thank you.
ReplyDeleteweb programming tutorial
welookups
ReplyDeleteThank your valuable content.we are very thankful to you.one of the recommended blog.which is very useful to new learners and professionals.content is very useful for hadoop learners
Best ASP.NET MVC Online Training Institute
Best Spring Online Training Institute
Best Devops Online Training Institute
Best Datascience Online Training Institute
Best Advanced java Online Training Institute
Best C-language Online Training Institute
Best Hadoop Online Training Institute
Best UI-Technologies Online Training Institute
Best Digital Marketing Online Training Institute
It was a great article. You explained well and good. There is one more blog which is also related to this and also giving the services of PHP programming online course. Visit this blog it will be very helpful to you and it is also providing many services.
ReplyDeleteOnline free PHP Tutorial Beginners to advance level Best free php web development tutorial for beginners to advance level
Deletethank you.
ReplyDeletelearn php7
Thanks for showing the post about of php development. I am a Beginner in programming language so this will help me to understand how php will help me to enhance my career in web development.
ReplyDeleteHire Xamarin Mobile app Development Company Texas USA
ReplyDeleteHii author,
thanks for sharing the valuable information about php development.
online food software Gurugram ncr
Food delivery App
mobile food ordering app
APTRON Solutions is an excellent PHP programming course in Delhi with superior integrated infrastructure and newly designed labs for students to practice and pursue training for multiple courses at Delhi.
ReplyDeleteFor More Info: PHP Course in Delhi
artikel yang bagus gan, sangat bermanfaat...
ReplyDeleteWeb Design
Web Developer
Online free PHP Tutorial Beginners to advance level Best free php web development tutorial for beginners to advance level
Deleteif you want to pop up your website then you need outlook 465
ReplyDeleteCreative Agency In Jaipur Design Dream and Live
ReplyDeleteWhy go by bus when Best Carpooling !! is affordable
ReplyDeleteWhy go by bus when Best Carpooling !! is affordable
ReplyDeleteThis article is a great article that I have seen so far in my programming career, it helps me a lot to build my logic in PHP and many other programming languages, And will continue to do so in the future.
ReplyDeletewebsite development company in Surat Gujarat
The best services of Website Designing Company in Noida & NCR. One of the best website developer companies with a affordable price. For more details call: 9015664619
ReplyDeleteThe Best Tattoo School in Delhi NCR.
ReplyDeleteWe are providing the Best tattoo school in Delhi. There are so many types of tattoo like Body Tattoo, Back Tattoo, Wrist Tattoo, Full Body Tattoo, Tattoo for Men, Tattoo for Women in Delhi Tattoo gives a different look to your body. Lots of design of tattoo in the market. For more details call: 8745801112
ReplyDeleteAwesome...
ReplyDeleteOnline free PHP Tutorial Beginners to advance level Best free php web development tutorial for beginners to advance level
Online free PHP Tutorial Beginners to advance level Best free php web development tutorial for beginners to advance level
ReplyDeleteOnline free PHP Tutorial Beginners to advance level Best free php web development tutorial for beginners to advance level
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIf you want to become a PHP developer in 2021. Softlogic Systems is here for you. We are a Chennai-based leading software training institute. Please visit our website for more info.
ReplyDeleteBest PHP Training Institute in Chennai
Thanks for Sharing this Information. PHP Training Course in Gurgaon
ReplyDeleteThanks for Sharing This Article.It is very so much valuable content
ReplyDeleteAutomation Anywhere Training in Chennai
you have written an excellent blog.. keep share your knowledge...
ReplyDeleteSelenium with Java Training
Selenium with Python Online Training
Selenium with Java Course
Python Automation Testing Course
Top web development company in kanpur to know more visit this link
ReplyDeleteTop web design company in kanpur to know more visit this link
Hi, Thank you for sharing a useful article
ReplyDeletePHP is the most popular web development programming language, PHP frameworks that follow the Model-View-Controller (MVC) pattern. BitCot is the PHP Development Company in San Diego USA to create well-organized, reusable, and maintainable code: Cake PHP, Laravel, Symfony, Yii 2, CodeIgniter. Over 250 million web apps & sites draw on PHP benefits:
php tutor in gurgaon
ReplyDeletehttps://www.bestforlearners.com/course/gurgaon/best-php-course-training-institutes-in-gurgaon
thank you
ReplyDeleteWeb Designing Training in Chennai
I have read your blog its very attractive and impressive.
ReplyDeleteVisit us: Dot Net Online Training
Visit us: Dot Net Online Course
ReplyDeleteThat's indeed a very detailed list of blog commenting websites.
custom on-demand app development
Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
ReplyDeletePHP Experts in India
I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Learn PHP
ReplyDeleteGreat Post! Thanks for sharing. Keep sharing such information.
ReplyDeletephp Training in Noida
Thanks for the great article. Interesting and useful
ReplyDeleteRecycler in India
Great Post! Thanks you. Keep sharing such information with us.
ReplyDeleteHenna Hair Colors Manufacturer
SAP BI Training In Noida
ReplyDeletePHP is the most popular web development programming language, PHP frameworks that follow the Model-View-Controller (MVC) pattern. Dipole Tech Innovations (OPC) Pvt Ltd is the Top PHP Development Companyin Los Angeles, New York, USA to create well-organized, reusable, and maintainable code: Cake PHP, Laravel, Symfony, Yii 2, CodeIgniter. Over 250 million web apps & sites draw on PHP benefits. Get A Free Quote
ReplyDeleteAPTRON, a leading training institute in Gurgaon, offers a comprehensive PHP Course in Gurgaon designed to equip you with the knowledge and practical experience needed to excel in this dynamic field. Whether you are a beginner or an experienced developer, our PHP course is tailored to meet your specific learning needs and help you achieve your career goals.
ReplyDeleteIf you're taking your first steps into the world of web development and looking to explore the realm of PHP programming, you've come to the right place. Welcome to APTRON's Beginner's Guide to PHP, your gateway to mastering this versatile and powerful scripting language.
ReplyDeleteIf you're looking for PHP Training in Noida that empowers you with the skills to excel in the web development industry, look no further than APTRON Solutions. Our commitment to quality education, expert trainers, and hands-on experience sets us apart. Don't miss this opportunity to master PHP and transform your career. Contact us today to inquire about upcoming batches and start your journey toward web development success.
ReplyDeleteAPTRON, a renowned training institute, offers a comprehensive course that delves deep into these Advanced Topics in PHP, empowering developers to build cutting-edge web applications. we'll explore some of the exciting subjects covered in APTRON's advanced PHP program.
ReplyDeleteGreat post!
ReplyDeleteI am always impressed by the quality and depth of information in your blog posts. Thank you!
Looking for the top remote developers in India? Join forces with our skilled professionals for unmatched expertise and seamless collaboration. Get started today!