bingorabbit’s bLOG - when rabbits rule!..

Status Report-04

By: bingorabbit, July 17, 2008 @ 9:12 am
Filed under: college, depiak, dreams, linux, php, wordpress
Tags: , , , , , , ,

ICU, My Grandpa, Family! Al-7amdolelah

2008-07-17 :) , wemabre7 kan 3omry 20 :)

I’m waiting for my results..

I will be having an interview after ummmm 5 hours?&!

depiak, good work and a great comeback!

I love Linux!! - Mosh awy -

Wordpress 2.6, again, they always impresses me!

PHP, MySQL, Java and SCJP!

Smileys, again

parameters with default values

By: bingorabbit, June 11, 2008 @ 6:24 pm
Filed under: information.technology, linux, my.hacks, php, web
Tags: , , , ,

It’s known that declaring a php function has the following syntax:

<?php
function function_name(Parameters_list) {
// function
// code
// block
}
?>

an example of this can be like this:

<?php
function nameAndAge($name,$age){
echo "Welcome $name, you are $age years old!";
}
?>

When I issue the following statement:

<?php
nameAndAge("bingorabbit",20);
?>

I will get:
Welcome bingorabbit, you are 20 years old!

Most of us know that, and also we know that to set a default value for any parameter, we can do the following:

<?php
function function_name($parameter1 = "default value", rest_of_the_parameter_list) {
// function
// code
// block
}
?>

which might take the following form:

<?php
function nameAndAge($name="bingorabbit",$age){
echo "Welcome $name, you are $age years old!";
}
?>

so when I issue:

<?php
nameAndAge();
?>

I will get:
Welcome bingorabbit, you are years old!

and when I issue:

<?php
nameAndAge("Ahmed", 15);
?>

I will get:
Welcome Ahmed, you are 15 years old!

The problems is such declaration is that, you can’t just issue:
Read More..