Loading...
start the course

Learn PHP

Codes and notes

Variables
Back Next

Variables are "containers" for storing information.
Creating (Declaring) PHP Variables In PHP, a variable starts with the $ sign, followed by the name of the variable

<?php $txt =my name echo $txt ? >

Back Next

Code editor

        <!DOCTYPE html>
        <html>
        <body>

        <?php
        
        # example of variables in php
        
        $txt

        ="enjoy php";
        echo
         $txt;
         enjoy php

        ?>

        </body>
        </html>
    

Output