Is it better to use single or double quotes when coding with PHP?

1 Answer

Answer :

They’re actually interpreted differently. See here.

Related questions

Description : Select NORTH', CUSTOMER From CUST_DTLS Where REGION = N' Order By CUSTOMER Union Select EAST', CUSTOMER From CUST_DTLS Where REGION = E' Order By CUSTOMER The above is a) Not an error b) Error - ... ' and SOUTH' c) Error - the string should be in double quotes d) Error - ORDER BY clause

Last Answer : d) Error - ORDER BY clause

Description : Do people "over use" "double quotes" more than is "necessary"?

Last Answer : “No.”

Description : What is a PHP error?

Last Answer : It’s to do with encryption. PHP means Pretty High Privacy or something like that. IT means that the data sent was not encrypted. This might happen on a website that starts with https. What were you doing at the time?

Description : What is the most popular PHP framework available?

Last Answer : I’m lazy and will just answer the last question. I use CakePHP when I need too since I’m familiar with it and it gives me the least problems out of the ones I have used. But I avoid them and usually just do everything from scratch.

Description : Is there any way to edit php without code?

Last Answer : Nope. Because it’s more of a scripting language than a programming language like BASIC or C and than a mark up language like XHTML. PHP isn’t too hard to learn though (or so I’ve heard)

Description : What's the easiest way to learn how to code in CSS and PHP?

Last Answer : tizag.com

Description : How do I check for the existence of a particular MySQL table using PHP? (Using an IF statement.)

Last Answer : answer:I don't know of a preexisting function, so here's one I wrote real quick (untested): function checkTable ($table_name, $database_name) { $my_tables [equal] mysql_list_tables($database_name); while (list($foo) ... , your_database )) { // Table exists } else { // Table does not exist }

Description : PHP Gurus: What is the easiest way to generate a specified length string of random alpha characters?

Last Answer : answer:Well, this code will spit stuff out per your “For example” Not sure what alpha characters are though… Check it here.

Description : Which is better between PHP and ASP.net?

Last Answer : answer:I prefer PHP. It is well documented and very portable. ASP is non starter for me since I refuse to use IIS. I like Ruby and Python too. But when I have to start a project from scratch I use PHP and CodeIgniter.

Description : A static dictionary technique that is less specific to a single application is: a. LZ77 b. Diagram Coding c. Initial dictionary d. LZW

Last Answer : b. Diagram Coding

Description : A 300mm diameter pipe, 5mm wall thickness is to be radiographed using the double wall single image technique. The source to be used is Iridium. Which of the following statements is true? a) ... problem with the technique d) Only the double wall, double image technique should be used with Iridium

Last Answer : c) There is no problem with the technique

Description : What demonstrates the power of words better then quotes?

Last Answer : answer:The needs of the many outweigh the needs of the few. Or the one. Spock

Description : Which is a better value - double roll or single roll toilet paper?

Last Answer : This isn’t something I have put much thought into, but it seems that I run out much quicker if I use single rolls. So I buy half as many doubles, and it seems to be the most cost effective for me.

Description : Which Font(s) Do You Use For Coding?

Last Answer : Monaco 11pt with anti aliasing

Description : Coding in C++: How do you display a random array?

Last Answer : answer:Are you having trouble generating the array or just displaying it? I’m curious about the choice of C++ too. There are other languages where this would be much simpler.

Description : How can you find out where a picture was taking by looking at the coding in the file?

Last Answer : answer:It is called EXIF data. Here is a tool that will show you the info. http://regex.info/exif.cgi Here is a URL of a picture I took today while walking the the laundromat. http:// ... are tools to strip the EXIF data if you are concerned about it. That nailed my location within a meter.

Description : Should coding skills be considered a second language?

Last Answer : How do you say “go make me a sandwich” in Java?

Description : Where can I find a great coding reference site online?

Last Answer : http://w3schools.com/

Description : If I already know basic PHP/MySQL, what else should I learn to use Google App Engine?

Last Answer : answer:I am not an expert, I just started reading up on this myself, but here are a couple of starting points on data storage. Rather than a separately maintained SQL database, ... .com/appengine/articles/datastore/overview.html http://code.google.com/appengine/docs/python/datastore/overview.html

Description : Could I use ASP,PHP,JSP all in one website?

Last Answer : i use my psp at work all the time.

Description : How do I use PHP to get the node ID for a block?

Last Answer : answer:$node is a widely available object in Drupal. $node->nid will give you the node id of the current node. Your template could look something like this:

Description : How can I learn to use Flickr's API in PHP without PEAR?

Last Answer : Use another library, there must be dozens. I work with the Zend Framework which contains one (and since it's loosely coupled, you can use it on its own), but I just realized it requires PHP 5. ... a few of the API kits suggested on Flickr but two use PEAR and the other requires PHP5 ) though.

Description : How to use for loop in php ? -Php

Last Answer : Syntax for for loops in php : for (init counter; test counter; increment counter) { code to be executed for each iteration; } Where: init counter: Initialize the loop counter value test counter ... to FALSE, the loop ends. increment counter: Increases the loop counter value Example is here :

Description : Is it possible to store PHP scripts in the cloud?

Last Answer : answer:Yes Simplest example would be to grab the script from a service, stick it in a variable and eval it. Could you provide an example of why you’d want to? I can’t think of a good reason to do it offhand.

Description : What is the difference Java and PHP?

Last Answer : …so what exactly is your question?

Description : What are the best web sites to get help with Apache, PHP, and MySQL?

Last Answer : stackoverflow is the best site programming q & a site I know of. Looks like there is a fair amount of LAMP-related questions there.

Description : Does GoDaddy have some PHP functions disabled by default?

Last Answer : Doesn’t look that way, but I can’t really tell. Your host does appear to suck.

Description : What's wrong with this simple PHP script?

Last Answer : answer:Do you need a concatenation operator (.) between your string and the variable name ($the_long_url)? But like this: ’”.$var.”’ http://www.gidforums.com/t-965.html

Description : What is the best text editor for HTML/XHTML/CSS/PHP/SQL on Ubuntu?

Last Answer : Take a look at Geany

Description : What's your favorite PHP integrated development environment (IDE)?

Last Answer : If I did PHP development, I’d probably use Coda: http://www.panic.com/coda/

Description : What's the best way to deploy a PHP application?

Last Answer : answer:debian package At a previous job I had to install/maintain a site written in CakePHP. I made it into a debian package. “aptitude install projectname” and you’re done (although I guess that is technically “touching the server”) Send me a PM and I can give you the details.

Description : PHP problem with && and possibly a malfuntioning array?

Last Answer : answer:Unfortunately the examples above don't really shed a lot of light without some additional information. Maybe we can help with some troubleshooting tips in general? A couple of things that come to mind ... is where you're expecting it. Good luck with it, I hope it all comes together.

Description : As a specialist PHP/MySQL programmer at my (not so fun to work at) job, what's my future?

Last Answer : It depends if you want to continue doing programming or not. If you have good people skills, and good business sense, you could get PMP certified, or learn VersionOne and move to the business ... business side. We also prize business analysts with SQL knowledge in order to manage data and metrics.

Description : Using a PHP page to post "blog" entries on my website.

Last Answer : answer:It shouldn't be too hard- you'll probably want to apply the CSS to the page that is retrieving and displaying the information, not the page you use to enter it. Whatever code is generating your ... CSS classes, id tags, and DIVs to. It's hard to get specific without actually seeing the code.

Description : Php logging in problems? learning php?

Last Answer : answer:It means that it got to the end of the file and was expecting a ”}” and didn’t find one. Quick count of your braces: { = 7 } = 6 Yup, you’ve got a mismatch.

Description : Finding PHP video to help create sign up?

Last Answer : answer:I haven't ever heard of anyone learning PHP with video, but what you'll need is to create another form with the relevant boxes (name/email, password, confirm something for some reason). ... to google something like programming resources or PHP resources and look for what other people did.

Description : Which windows application for writing PHP codes?

Last Answer : answer:Don’t know about compiling php? and debugging is also foreign to me. But Notepad++ is awesome.

Description : Is there software that you can call from, for example a PHP script, to translate languages?

Last Answer : Google AJAX Language API

Description : How to make cookie in php track both in www.site.com and site.com for some web-site?

Last Answer : answer:Set the domain argument to just '.site.com', including the leading period, rather than accepting the default (which will be whatever the current domain is) http://php.net/manual/en/function.setcookie.php ... So you might have something like: setcookie( my_cookie', 123, 0, , '.site.com');

Description : Is there a server-side utility that I can call from PHP to automatically resize and crop an image, such as an avatar, uploaded by a user?

Last Answer : http://www.imagemagick.org/script/index.php

Description : What is apache or perl or php or mySQL?

Last Answer : Apache, Perl, PHP, MySQL Seriously, Wikipedia does wonders. Also try searching with Google.

Description : Is there a server-side utility that I can call from PHP to spell check a user's input from a text box?

Last Answer : There are a bunch of them out there. Here’s a PHP spell checker class.

Description : PHP/MySQL question.... (please read on)

Last Answer : Have you looked through these?

Description : What are the differences between Perl, PHP, and Python?

Last Answer : Um, i unfortunately cannot answer this question, but I have to ask: why the NSFW tag?

Description : What is a good book for learning PHP and MySQL?

Last Answer : I’d start here: http://www.php.net/manual/en/ Get a feel for PHP, then buy books to fill in the gaps or get deeper into particular areas.

Description : How long does it take to learn PHP & MySQL?

Last Answer : The O’Reilly Head First book on this is great.

Description : PHP echo number of instances if specific word?

Last Answer : make a while loop that goes through the contents of the array. prior to the array define a counting variable and give it the value 0. during each loop, increase the value by 1 if the word “and” is encountered

Description : Server issue or PHP? - Contact Form Not Sending HTML correctly?

Last Answer : Next time use Pastebin. I think your problem is somehow HTML related, like a missing tag, or validation error. Try just sending a text email and build pieces bit by bit from. Outlook and other email ... in how they parse HTML, whereas Gmail (browser based to begin with), isn't quite as finicky.

Description : PHP help... contact form problem.

Last Answer : You should probably do an ajax form submit and replace the form with the confirmation message. I’ve got to get to bed, but I’ll find a tutorial for you in the morning if someone else hasn’t already. (basically, opposite of this: http://24ways.org/2005/edit-in-place-with-ajax)

Description : Make an archive-like page in PHP?

Last Answer : Hi Davey, Here is some quick and dirty code for your showarticlesfor($year)' function which should get the job done (NOTE: I am assuming you are using MySQL as your DBMS): function ... few breaks, and finally by the records (the while loop). References: MySQL DATE_FORMAT PHP mysql_fetch_assoc()