Thursday 11 March 2021

php: strings

String is a collection of characters. You can enclose collection of characters in either in single quotes or double quotes.

 

strings_demo.php

#!/usr/bin/php

<?php
    
    $var1 = "Hello Wold";
    $var2 = 'Hello World';
    
    echo $var1 . "\n" . $var2;
?>

 

Output

$./strings_demo.php 

Hello Wold
Hello World

 

 

 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment