1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

What is a String?

By

A string is a type of data. A string can contain letters, numbers or characters. Although a string can contain numbers, it is not a numeric value. A string can be short or long. Here are some examples of strings:

<?php
$stringA = "Look at my string";
//a string can be a sentence
$stringB = "Hello";
//a string can be a word
$stringC = "Matchbox 20";
//a string can contain numbers and letters
$stringD = "Look @ the symbol";
//a string can contain symbols
?>

If you are unsure if a value is a string, you can use the is_string () function to check.

  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Programing Glossary
  5. What is a String?

©2014 About.com. All rights reserved.