: This article mainly introduces the basic syntax for getting started with php. For more information about PHP tutorials, see. After I started my blog, I failed to write an article for a while. today I will introduce the basic syntax of php. In terms of syntax, php and c ++ are quite similar. well, if you don't need to talk nonsense, go directly to the code.
It can be omitted if no other content exists after the end of the php code // the variable in php does not need to declare the Type $ num = 1; // if statement if ($ num = 1) {$ total = 1 ;}else {$ total = 0 ;}// loop structure while ($ total <10) {$ total ++ ;} // of course, the loop structure also includes for and do while // The Output Content echo $ total is demonstrated below; // echo is used to print the content, the above program outputs $ total content // The UDF addOne ($ value) {$ value ++; return $ value ;}// the function in php does not need to specify the return type, the return data type can be any or not.
I have written so much today. next time I will introduce how to use php for mysql database operations.
The above describes the basic syntax for getting started with php, including some content. if you are interested in the PHP Tutorial, please follow the PHP Chinese website (www.php1.cn) for more information )!