PHP Notes
PHP Notes
1)What is PHP?
Ans: PHP, which stands for Hypertext Preprocessor, is a widely
used server-side scripting language designed for web
development. It is particularly well-suited for creating dynamic
web pages and can be embedded within HTML code.
The data type of PHP constant cannot be The data type of the PHP variable can be
changed during the changed during the
execution of the script. execution of the script.
A PHP constant once defined cannot be A PHP variable can be undefined as well
redefined. as can be redefined.
PHP constants are automatically global PHP variables are not automatically global
across the entire script. in the entire script.
Multidimensional Arrays:
A multidimensional array is an array of arrays, or an
array whose elements can be arrays.
Useful for representing tables or matrices.
Example:$matrix = array(
array(1, 2, 3),
array(4, 5, 6),
array(7, 8, 9)
);
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>
</body>
</html>
<body>
<!-- Heading -->
<h3> HTML input form </h3>
</html>
<?php