Home > Backend Development > PHP Tutorial > photoshop cs2 v9.0 green Chinese version PHP entry learning knowledge point seven basic application of PHP functions

photoshop cs2 v9.0 green Chinese version PHP entry learning knowledge point seven basic application of PHP functions

WBOY
Release: 2016-07-29 08:46:04
Original
1396 people have browsed it

Copy the code The code is as follows:


/*
* Simple function
*/
function fontBold($con){
return "$con" ;
}
$str="Simple function test!";
echo "Normal text: $str
";
echo "Bold text:".fontBold($str)."";
/*
* Function with optional parameters
*/
function fontColor($con,$color="bule"){
return "$con";
}
$str="Color test";
echo $str;
echo fontColor($str."This is without color parameters (default is blue)!");
echo fontColor($str,"red"." This is with a color parameter (red by default!)");
/*
* Recursive function
*/
function chckint($Num){
if($Num>1){
return chckint($Num-1 );
}else if($Num<0){
return chckint(($Num*-1)-1);
}else{
if($Num>0 && $Num<1){
return false;
}else if($Num){
return true;
}
}
}
$Num=3;
if(chckint($Num)){
echo $Num."It’s an integer!";
}else{
echo $Num."Not an integer";
}
/*
*Dynamic call function
*/
function write($con){
echo "$con";
}
function writeBold($con){
echo "$con";
}
$myFupnction="write";
$myFupnction("This is an example of dynamically calling a function without bolding it!");
$myFupnction="writeBold";
$myFupnction("This is an example of dynamically calling bold!")
?>

The above introduces the basic application of photoshop cs2 v9.0 green Chinese version PHP introductory learning knowledge point seven, including the content of photoshop cs2 v9.0 green Chinese version. I hope it will be helpful to friends who are interested in PHP tutorials.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template