Most of us use only Double Quotes ["] when writing PHP code. it seems like the trivial thing to do and most examples out there show this kind of syntax. However, there is also a 2nd way to go and it's the better way to go. Instead of Double Quotes, just use Simple Quotes.
echo "My Name is $name.";
However, using single quotes forces variables to be outside the quotes; instead, you must use theperiod (.) to combine strings. It makes for faster coding but can be more difficult for other programmers to read.
echo 'My Name is ' . $date[?day?] ';
The use of single and double quotes also applies to associative arrays. The associative entry team on the left side needs to have single quotes around it; otherwise, PHP will think it's a define and give you a warning message (only if error reporting is at maximum). I would recommend that the code should look like this:
$SESSION['team'] = $SESSION['old_team'];
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2013
(219)
-
▼
October
(23)
- How to hack Facebook account
- SEO Friendly PHP content management system
- No title
- What is PHP and MySQL
- Remote GUI Activation in Ubuntoo
- Start your script with AJAX
- 隞�憭拙末���敹���� ��萄�萄��
- Mountain Hiking With Your Dog
- Avoid space in your code
- Tipos de datos en Php
- Como manejar archivos con Php
- imagecreate() or image create in php
- check array index or key with user inputs in php
- Speed optimization
- JavaScript replace() Method
- arrays display in php
- Capítulo 19: Funciones adicionales de PHP
- Fatal error: Call to undefined function mysql_conn...
- Difference between single quotes and double quotes...
- Load balancing using Mod_Rewrite and perl
- Data types
- Subhajit Das | PHP Developer Kolkata: Subhajit Das...
- PHP include_once statement
-
▼
October
(23)