Lost Password?


  #1 (permalink)  
Old 01-10-2007, 06:10 PM
clookid's Avatar   
clookid clookid is offline
Programmer
 
Join Date: Jan 2007
Posts: 148
Rep Power: 7
clookid is on a distinguished road
Default Strings

Strings

Strings are text, pure and simple. There's two ways of storing strings, inside single quotes and double-quotes. Using "double-quotes" allows you to use special characters like \n for a newline. The backslash character marks the next character as special, though the only characters you can backslash in 'single-quoted' strings are \' (a single quote) and \\ (a backslash).

Some other special characters (for double-quoted strings)

PHP Code:
t


TAB

n


newline



carriage-return. In DOS text-files, a new line is \r\n, though in practice in Windows you can get away with UNIX format, which is just \n

PHP Code:
$


$

'


'

"



The most important difference between single and double-quoted strings is that double-quoted strings can contain variable names:

PHP Code:
$foo 'This doesn\'t work'// Oh yes it does!
$foo "Matt's second line also works";

$age 18;
echo 
'Bob is $age'// prints "Bob is $age"
echo "Bob is $age"// prints "Bob is 18" 
Check out the manual for more string stuff -- this is generally enough to get along with in daily use.

This tutorial was written by another one of my friends, if you would like to use this tutorial please send me a PM

Last edited by clookid; 01-11-2007 at 12:50 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-11-2007, 09:37 PM
xtraze xtraze is offline
Programming God
 
Join Date: Dec 2006
Location: Sri lanka
Posts: 921
Rep Power: 0
xtraze is on a distinguished road
Send a message via MSN to xtraze Send a message via Skype™ to xtraze
Default

I like the last one, " are needed when inserting variables, right.
And who is the friend you are saying about, is he in codecall ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-13-2007, 04:23 PM
clookid's Avatar   
clookid clookid is offline
Programmer
 
Join Date: Jan 2007
Posts: 148
Rep Power: 7
clookid is on a distinguished road
Default

No he is not in CodeCall, he is at another forum that I moderate.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting Strings with Empty Separator (Python) Matt Python 3 05-18-2007 01:27 PM
VB strings to C DLL malachi1984 Visual Basic Programming 0 05-11-2007 06:36 AM
Converting DB values into strings ashleysmithd Pascal/Delphi 5 04-24-2007 12:21 PM
Combine two strings Chan PHP Forum 6 09-29-2006 07:02 PM


All times are GMT -5. The time now is 06:19 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads