CourseLecture Familiarization With String Functions in PHP
CourseLecture Familiarization With String Functions in PHP
Example:
Viewing output in PHP
PHP echo and print statement
Example:
<html>
<body>
<?php
//This is a comment
/*This isa commentblock*/
?>
</body>
</html>
Arithmetic Operators in PHP
+ - */%
++ --
= += -= *= /= %= .=
many operators auto-convert types: 5 + "7"
is 12
Variables in PHP
- All variables in PHP start with a $ sign symbol. Variables may contain strings, numbers, or
arrays.
Syntax:
$variable_name = value;
<?php
$age = 30;
?>
Example:
<?php
echo strrev("Hello Jay!"); //Output !yaJ olleH
?>
PHP String Functions
strpos() - Search For a Text Within a String
Example:
<?php
echo strpos("Hello Jay!"); //Output 6
?>
End of Presentation