php tutorial - PHP Datatypes String - php programming - learn php - php code - php script




  • A string is series of characters, where a character is the same as a byte.
  • This means that PHP only supports a 256-character set, and hence it does not offer any native Unicode support.
php - php 7 - php tutorial - php framework tutorial - php examples - php sample code - php basics - php web development - php components - php project - php technology  - learn php - php online - php programming - php program - php code - html code - embedded php in html - php-string-datatype

php code Syntax :

<?php
    $x = “String Statement”;
?>
click below button to copy the code. php tutorial - team

  • A string can be of any text inside quotes, alphanumeric characters, which can be represented in single or double quotes.

learn php Sample Code : a simple php program

<!DOCTYPE html>
<html>
    <head>
        <title>Datatype-String</title>
    </head>
    <body>
        <?php
            $x = "www.wikitechy.com";
	    $y = 'Welcome to wikitechy world..!!';
	    echo $x;
	    echo "<br>"; 
	    echo $y;
        ?>
    </body>
</html>
click below button to copy the code. php tutorial - team

php for beginners Code Explanation :

Code Explanation for Datatype String In PHP

  1. In PHP, we created two variables. First variable is $x variable which specifies and holds “$x = www.wikitechy.com” string value, which will be displayed in the output by the echo statement echo $x;
  2. In PHP, we created two variables. Second variable is $y variable which specifies and holds ‘$y =Welcome to wikitechy world..!!’ string value, which will be displayed in the output by the echo statement echo $y;

php tutorials Sample Output :

output for Datatype String In PHP

  1. Using echo statement, the term “www.wikitechy.com” is shown in the browser window.
  2. Using echo statement, the term “Welcome to wikitechy world..!!” is shown in the browser window.


Related Searches to php datatype string