PHP Basic: String Data TypeTag: data type, string Category: PHP Basicpost: 01 Mar 2008 read: 218 PHP Basic Data Type Step By Step Tutorial - Part 5: String is a group of character. In PHP, a character is considered to be become a byte so that there is 256 character differ. A string literal can be expressed with three ways of differing: Single Quoted, Double Quoted, Heredoc Sintax. Single QuotedString can be expressed with single qoute clasp. With a single qoute, the variable which exist in it will be considered as a string literal so that value which exist in the variable do not be presented. Pay attention to the script as following: File name : string.php
The result of executing string.php:
Double QuotedIf the string is expressed flankedly by Double Quoted, PHP recognizes the more special character (character escape). Differ from single qoute, variable which exist in Double Quoted will be presented by its value. Table character escape
Pay attention to the example of script using String data type with double quoted as following:
The result of string.php :
Heredoc Sintax ("<<<")String also can limit by using the sign of heredoc sintax ("<<<"). Identifier writes after the sign <<<, followed string, then it is covered with same identifier Pay attention to the example of using String data type with heredoc sintax at script as following:
The result of string2.php:
| ||||||||||||||||||
| | Give Your Opinion | Recommend |
|

