| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2004
Posts: 1,383
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Quick PHP question Hey guys, I just picked up a book on PHP today. The author does describe when to use single quotes ( ' ' ) and when to use double quotes ( " " ). Like he said to use double quotes when the variable $PHP_SELF was being used. I'm a bit lost on it though and I was wondering if someone could help me out here on when it's a good time to use single quotes and when to use double quotes and what they should be used with. Any help would be appreciated, Thanks ![]() -Andy |
| |
| | #2 (permalink) |
| New Member Join Date: Jul 2005
Posts: 5
![]() | "" allows you to us multiple lines and '' does not. U can get away with using both with out having any issues. Just depends on how you want things to look when you view the source in a browser.
__________________ ***************************** Benjamin Sterling http://www.sterlingdesign.info http://www.webgraphds.com |
| |
| | #3 (permalink) |
| New Member Join Date: Sep 2003
Posts: 13
![]() | double quotes parse variables. single quotes do not PHP Code: http://us3.php.net/types.string |
| |
| | #5 (permalink) | ||||
| Senior Member Join Date: May 2005 Location: I'm right here
Posts: 3,526
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Although some people will prefer single quotes, you can still use a variable the following way
__________________ WP Theme Developer Your One-stop for Premium Magazine/CMS WordPress Themes Deluxe Themes | ||||
| |
| | #6 (permalink) |
| NamePros Regular Join Date: Mar 2005
Posts: 912
![]() ![]() ![]() ![]() ![]() | Hi ppl, I just wanted to know if is it possible to parse variables with single quotes cause i tried it and both work for i think single quote don't need to be escaped in double quote and vise versa.
__________________ Live Support : Zubair11 [at] hotmail.com Free SEO Directory! || Free Online TV || Tech Blog Web Design & Web Development Services || Reliable Web Hosting |
| |
| | #7 (permalink) |
| Professional Monkey Join Date: Jul 2005 Location: Escaped from the zoo
Posts: 907
![]() ![]() | generally speaking you should always use double quotes with \ to escape special meaning you can use single quotes but its messy and will cause problems in some situtations
__________________ Webmaster Words |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 12:35 PM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 10:09 AM |
| Quick PHP question - fopen() and related | Jeanco | Programming | 4 | 06-07-2004 09:28 AM |