PHP Strings - Code

PHP Basic Errors Previous Next PHP Type Conversions


As we already know, a string is traditionally a sequence of characters and it must be created before using it.

Examples

Filename: php / strings.php


Code

Running Step.


Type Url - https://localhost/php/strings.php

Double-quotes allow more flexibility becouse many special escape sequence characters can be used with it,

which cannot be used with a single-quotes string.

For example, the following escape sequence characters can be used with a string.

Filename: php / strings-advance.php


Code

Running Step.


Type Url - https://localhost/php/strings-advance.php

The above escape characters are not very useful when showing the output on a web page becouse HTML ignores exta white space.

A tab , newline, and carriage return are all examples of extra white space which is simply ignored by the browser.

Hence these escape characters are useful only when creating or writing to a text file etc.

In order to concatenate two strings the dot'.'

For example, in order to join two strings we can use the above operator

Filename: php / strings1.php


Code

Running Step.


Type Url - https://localhost/php/strings1.php


Tags: PHP Strings PHP Code Programming Language


Was this helpful ?

Related Code