Monday, 2 April 2018

php 3- lecture (php functions)

php functions :( Devdigs/ Dallas Website Development)

in more detail now just a quick review we find a function using
the constrict function followed by the name inside the round brackets we
have functions arguments separated by a common and you can think of
arguments as future place holders for the actual values and when we call a
function we used a function again the round brackets and inside we have the
parameters every by the common and the letters and the actual values for the
arguments so these parameters are going to be past over to the arguments and
inside functions code they're going to be modified or printed out or
whatever right it's so let's go ahead and so we're some function basics here
first of all going in this constant that i always define called h similar to
be and then let's create a function named multiplied and always going to do
is to by two numbers together a very very basic function just to illustrate
the next and i'm going to use a for return to return to values want times
too so so the return does is it basically you can for the return as a
valleys so if i call this function here and used to values five and six
nothing will happen in the output because because the valley is returning as
being returned back to as a variable basically so i would need to occur the
valley out and now you can see thirty as showing up here now if i wanted to
directly print devalue to the screen we can do sold by just using i go
inside the function and save echo one times tube and now if i use multiply
print ~~~~~~~ five's and turn this value as you can see ~~~~~~~ being
printed out direct directly to the screen without me using aqua keyword


because i already used that in the function so that just a little
distinction between the return and print in the valleys directly highlights
let's go had a move on here this so let's define a function that will print
some basic information about a person and inside the functions arguments you
can actually specify what kind of a data type you're going to include so if
i specified here this functions first parameter is only going to take today
as as its value so these that print our function here so if i use this
function here print and i specified something like string here i would get
to catch iqbal saddle fatal are argument one past to printing from must be
of type a string given so so if i did a raw now names wrote a key now i have
my arabian printed out so you can use what do they called basically they're
called type declarations so you can specifying what kind of a type the
functions argument is going to take in as a parameter and that's how you

that's how you do that you can also have some [UM] values here like for
example let me just go i had defined in our with some of my information
might in front called might inferred and i'm just going to have my basic
information and there it's like named [COUGH] michael named age ~~~~~~~ when
the gender ~~~~~~~ and the health ~~~~~~~ should be no for new now i'm just
going to insert this era inside a function just to make sure is still bring
printed out that's cool now i'm let's go ahead and

Written by Devdigs (Dallas Website Development)

No comments:

Post a Comment