PHP Basics
PHP Basics
Basic PHP Syntax PHP scripts start with <?php and end with ?>:
<?php
echo "Hello, World!";
?>
Save the file as index.php and run it in a browser through a local server.
Functions in PHP
<?php
function greet($name) {
return "Hello, $name!";
}
echo greet("Alice");
?>
Conclusion PHP is a powerful language for web development. Learning the basics will help you
create dynamic websites and applications.
Happy Coding!