A string is a series of characters and in PHP it is represented same or similar as in other languages, that is, a string is represented inside a quotation.
An example of a string would be:
<?php
$string = "This is PHP data types tutorial";
?>
String manipulating functions
Some of the functions that may be used to manipulate strings are listed below:
- Check length of a string with the function strlen().
- Reverse a string with the function strrev().
- Count the number of words with the function str_word_count().
- Replace the text with the function str_replace().
However string manipulation in PHP is much more complex than mentioned here. To learn more about PHP strings follow this link.
Comments
No comments have been made yet.
Please login to leave a comment. Login now