The company came to a newcomer, claiming to have written 8 months PHP, and then will write Mysql_connect, will not write loops, do not understand the two-dimensional array. The foundation is bad, let me want to hit death.
Oh, teach it, see if you can teach it.
-----------------------------------------------------------
There are 3 main variables of PHP. String, array, object
How to use them.
-----------------------------------------------------------
for string
$string = "string"
-----------------------------------------------------------
Build a test.php, test the following example to see what the output is different from, what's the same
$str = "I am a string";
Echo $str;
$str 2 = "He is an array, I am the string 2";
echo $str 2;
-----------------------------------------------------------
For array
$arr = Array (' key ' = ' value ');
-----------------------------------------------------------
Build a test.php, test the following example to see what the output is different from, what's the same
$arr = Array (' name ' = ' Zhang San ', ' php ' = ' beginner ');
Print_r ($arr)
$arr 2[' name '] = ' Zhang San ';
$arr 2[' php '] = ' beginner ';
$arr 2[' info '] = ' html proficiency ';
Print_r ($arr 2)
-----------------------------------------------------------
For object
$ob = new StdClass;
$ob->key = value;
-----------------------------------------------------------
Build a test.php, test the following example to see what the output is different from, what's the same
$ob = new StdClass;
$ob->name = ' Zhang San ';
$ob->php = ' beginner ';
Print_r ($OB)
$ob 2 = new StdClass;
$ob 2->name = ' Zhang San ';
$ob 2->php = ' beginner ';
$ob 2->info = ' also good ';
Print_r ($ob 2)