I have known php for a long time, but I have never had time to learn it. Now I have to learn php carefully, hoping to one day be freed from the cumbersomeness of c# Come out and move towards the simplicity and clarity of PHP. The huge development environment alone is enough trouble for me. I have to install vs and sql every time I install it.
Setting up the PHP environment is very simple, because I took a shortcut and downloaded wamp service 2.5 online. The official website is http://www.wampserver.com/. There are 32-bit and 64-bit versions. The download must be consistent with the system. version, otherwise strange errors will appear, which delayed me for a long time.
Of course you need books to learn a language. I found an electronic version of PHP Basic Tutorial 4 on the Internet, which is very suitable for PHP novices to learn. The following are my study notes. Record them for future reference. It is also a reminder for myself.
1. Several ways to output hello world
<?php echo "hello world!";
print "hello world!";
print_r("hello world!");
eval("echo \"hello world\";")<br />?>
echo can output multiple values at one time. echo is a language construct, not a real function.
print() only applies to scalar types such as numbers and strings. If the string is successfully displayed, it returns true, otherwise it returns false.
print_r() can simply print out strings and numbers, while arrays are displayed as a bracketed list of keys and values, starting with Array.
The eval() function will execute the php code in the string.