<?php
$wishes = "Hello!";
echo $wishes;
echo "<h4>PHP and Html Heading !</h4>";
?>
Html Output:
Hello!
PHP and Html Heading !
PHP TUTOR variables rules
php variables rules
- It must start with a letter or underscore "_".
- Can be comprised of alpha-numeric characters and underscores. a-z, A-Z, 0-9, or _ .
- Variables with more than one word should be separated with underscores. $first_secondvariablename
- Variables with more than one word can also be distinguished with capitalization. $ItsMyName
PHP variable
$variable_name = Value;
Always Php Variables names are case-sensitive
<?php
$iamstring = "Hello World!";
$iam_number = 4;
$itsalsoNumber = 8;
?>
Always Php Variables names are case-sensitive
<?php
$iamstring = "Hello World!";
$iam_number = 4;
$itsalsoNumber = 8;
?>
PHP Simple Tags Example
Php Extension is filename.php
<html>
<head>
<title>Php Example</title>
</head><body>
<?php echo "Hello World!"; ?>
</body>
</html>
OutPut Will be
hello World!
<html>
<head>
<title>Php Example</title>
</head><body>
<?php echo "Hello World!"; ?>
</body>
</html>
OutPut Will be
hello World!
PHP PROGRAMMING shorthand support
PHP stands for PHP Hypertext Preprocessor.
<php
// php Codes
?>
Shorthand PHP tag that requires shorthand support to be enabled
on your server so that we can use <? instead of <?php
<
//with shorthand support
?>
<?php
//without shorthand support
?>
Subscribe to:
Posts (Atom)