Monday, March 24, 2008

Difference between $message and $$message

eg1

$message = "ume";
$ume = "All Interview dot com";
echo $message; // Output: ume
echo $$message; // Output: All Interview dot com


eg2
$Message = "YOU";
$you= "Me";
echo $message //Output:- you
echo $$message //output :-Me

It means
$message is a variable and
$$Message is variable of variable

A variable of variable allows us to change the name of
variable dinamically

Mysql and Postgresql

Why we use MYSQL

MySQL is relatively faster than PostgreSQL.
Database design will be simpler.
You can create a basic Web-driven Web site.
MySQL’s replication has been thoroughly tested.
There’s no need for cleanups in MySQL (Vacuum).

Why we use POstgresql

* Complex database design
* Moving away from Oracle, Sybase, or MSSQL
* Complex rule sets (i.e., business rules)
* Use of procedural languages on the server
* Transactions
* Use of stored procedures
* Use of geographical data
* R-Trees (i.e., used on indexes)

Difference between implode and explode functions

implode

implode acts on an array, and returns a string:
$array = ("Oasis", "Coldplay", "Foo Fighters");
$string = implode(", ", $array);
echo $string;
The above code outputs:
Oasis, Coldplay, Foo Fighters

explode

explode acts on a string, and returns an array:
$string = "Oasis, Coldplay, Foo Fighters";
$array = explode(", ", $string);
echo $array[0];
The above code outputs:
Oasis