Jump to Navigation


206 - Meaning $$ in PHP

$a_string = "This is a test.";
$a_var = "a_string";

echo $$a_var;

Output :

This is a test.


048 - print_r(), var_dump(), var_export()

var_dump() is a similar function to print_r(). It does largely the same thing, but it prints out size of variables,
it does not print out nonpublic data in objects, and it does not hava the option to pass a second parameter
to return its output.

print_r() :

[0] => value1
[1] => value01
[2] => value001

var_dump() :

003 - GET and POST

* $_POST
You can only use this in HTML form. This method takes the data from the form field and sends it through an HTTP header. The data cannot be seen in the URL(For much data, a lot of values.).

* $_GET
This method gets the data from the form fields, encodes it, and adds it to the destination URL (For one value).

Subscribe to RSS - variables

Main menu 2

by Dr. Radut