Friday, 28 February 2014

Basic Functions in php

Functions in php
Basic Functions in PHP Programming Languages. This tutorial is for Basic Functions. Why functions are useful in php and also in other programming languages? Lets see how we can create functions and use a function with our page. Firstly let me know you a function is something which allows you to declare a block of code that we may want to reuse,we use more arguments which is sometimes refractive.

Code for basic structure for functions(Screenshot1):-

Basic Functions In Php
Code for Basic Structure for Functions In Php Screenshot1

<?php



function MyName() {

echo 'Mohammed';

}



echo 'My name is <br>';

MyName();

?>

Output (Screenshot2):-

Basic function in php
Screenshot2
In this examples of basic structure of functions there is keyword “function” along with name of function i.e “MyName” and conditions in curly brackets. Since this example is basic so I am just showing you to echo out my name using functions. Then when we want to use functions we just had to call the function by name and conditions inside curly brackets are applied.
Now you need to think about it logically how you can use functions in your programs.


No comments:

Post a Comment

Thanks For Comment Will get you Soon..

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates