php

I often see some “programming gurus” use strange advanced syntax such as this one: somefunction(\WP_Query $query) { …. } This is a piece of php code. You know, usually php […]

Both var_dump and print_r can print php variables in detail. What is the difference between print_r and  var_dump? print_r displays less information than var_dump, thus more concise.  print_r only shows […]

Php has a SimpleXMLElement class to parse xml document. The official website gives quite a few examples on how to use it, but no explanation of related concepts. xml has […]

Html elements are so easy to learn. Even you are not major in computer science, even you are not a programmer, you can easily master them and use them to […]

Default flag for preg_match_all

The flag parameter of preg_match_all is complicated and confusing. The official document says the default value of flag is 0, which is wrong. In fact, the flag parameter is defaulted […]

You might think it is a hard work to upload a file. At the client side, do I need to write code to open the file, read its content, then […]

php iconv is an interesting function that can convert a string from one charset to another. $text=”abc”; $text = iconv(‘utf-8’, ‘us-ascii’, $text); In the above example, since the source file […]