DevelopPHP
home Forum gear home

Libraries book

HTML Library CSS Library JavaScript Library PHP Library

Videosbook

PHP and MySQL JavaScript HTML and CSS Vector and 3D Flash Actionscript Android Dev Miscellaneous

Resourcesbook

Website Hosting
Define String :-: Define Number   Share / Like
String

A string is any one or set of alphanumeric characters and spaces. A string may include letters, numbers, spaces, or symbols. There are several data types in PHP, and string is one of them. Here are the PHP data types again if you need to see them: Boolean, Integer, Floating Point Number, String, Array, Object, Resource, Null

When we create an HTML contact form for a website we might have name, email, phone number, and message fields. When the user types their information in and press submit, all of that information in all of those fields are interepreted as strings. When our PHP parse script picks up those field variables to email them to us, they are all strings. The name is a string, the email, the phone number, and finally the message, all are strings and all will be interpreted as string data when it comes time to parse it.

String Examples:
Learn HTML
<?php
$str1 
"Hello World!";
// Mix of Letters, Spaces, and Symbols
$str2 "(555)555-5555"; // Mix of Numbers and Symbols
$str3 "yourname@youremailsite.com"; // Mix of Letters and symbols
$str4 "3"; // Number... but if it is in quotes it is seen as string data type object
$str5 "a"; // Letter
?>

A string is simply one or any set of alphanumeric characters, spaces, and symbols.



Number

A number is anything that we would use for computational purposes or numeric representations that do not contain string type data, or any data that would make them anything but a number.

Number Examples:
Learn HTML
<?php
$num1 = 37; // Integer
$num2 = 2.75; // Floating point numbers
$num3 = -6; // Negative values
?>
Home   •   Terms of Use   •   Developer Forums   •   T-Shirts   •   RSS   •   Classroom Chalkboard   •   Donate   •   Top ↑
Popular In PHP / MySQL E-Commerce Store Production
Social Network Website Building
Image Upload / Photo Processing
CMS Software Programming
Mass Email Systems
Magic XML Data
Search Programming
Popular In JavaScript JSON Programming
Ajax Programming
Animating Elements
WYSIWYG Programming
Date/Time Programming
DOM Scripting
Object Reference
Popular In HTML Canvas Element
New Form Elements
Audio Element
Video Element
Drag and Drop
Event Handling
Element Grouping
Popular In CSS Custom Font Embedding
Dynamic Fit Backgrounds
Theatre Mode
Box Overlays
CSS Level 1 Properties
CSS Level 2 Properties
CSS Level 3 Properties
©2013 DevelopPHP   |   Navigate to related domains HTML5