Old 07-18-2009   #1 (permalink)
smw
Registered User
 

Join Date: Jan 2008
Location: Bremerton, WA
Posts: 15

Double Ending In PHP

This is a very basic question. I haven't coded in php in ages, and I've forgotten what character to put before special characters in php that represent the end of a line or piece of code. For instance the apostrophe. If simply want an apostrophe to show up is it \' OR /' ?

FOR EXAMPLE:
I've got an array that I'm using to insert a variable into a certain line in a php file.

PHP Code:
$f_arr[$i] = '$variable = 'example';'
I obviously can't have two matching endings. If $variable = 'example'; is exactly what I want written in the line of my php file. How would I fix this piece of code?

Last edited by smw; 07-18-2009 at 02:45 PM.
smw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-18-2009   #2 (permalink)
Janitor of Lunacy
 
Tamlin's Avatar
 

Join Date: May 2006
Location: Sitting in the Wishing Chair
Posts: 5,758
Blog Entries: 2
Images: 530

Battle Wins: 20 (rank: #1)
Is this what you mean?

PHP: addslashes - Manual
__________________

"I might join your century, but only as a doubtful guest"
Tamlin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-18-2009   #3 (permalink)
Registered User
 

Join Date: Aug 2004
Posts: 143

PHP Code:
if ($variable == 'example') { $f_arr[$i] = $variable;} 
And \ will ignore the apostrophe or quote that follows it.
__________________
Adobe Certified Expert, Illustrator
Jolt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-18-2009   #4 (permalink)
smw
Registered User
 

Join Date: Jan 2008
Location: Bremerton, WA
Posts: 15

Thanks

Thanks. You were both a lot of help.
smw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
too many images and double arb BioRUST Specific Threads 31 01-31-2007 11:16 AM
Ending letter word game thingyyy Djprayze General Discussions 19 08-23-2005 04:30 AM
Cinema 4D Double Whammy! Man1c M0g Announcements 2 10-09-2004 02:49 AM


All times are GMT +1. The time now is 01:00 PM.

Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT