Variables Continue:
You can have very useful functions with variables.
For example:
While i was designing a php website someone ask how do i find out what is the length of a variable in phpThe answer is simple and is provided for you in php with the function strlen() The use is:
You can have very useful functions with variables.
For example:
The above code will output in one line Welcome to my website (They words are not connected why? Because in the $var2 the beginning starts with space if it was not a space character there the programmer should do this echo $var1 . " " . $var2; This will print an extra space between the two characters.$var1 = "Welcome";$var2 = " to my website";echo $var1 . $var2;?>
While i was designing a php website someone ask how do i find out what is the length of a variable in phpThe answer is simple and is provided for you in php with the function strlen() The use is:
In php they are many functions that will help you with your string variables we will refer to them later in the tutorials$var1 = "Welcome to Cyprus have a Nice day";//call a function to show how many characters are in a varialbeecho strlen($var1);//The output should be: 33?>
No comments:
Post a Comment