PHP supports 8 basic types of data.
Four types of scalar:
Boolean (Boolean)
integer (integer type)
float (floating-point, also called double)
String (String)
Two kinds of composite types:
Array (arrays)
Object
phpMyAdmin is a frequently used MySQL management tool, backup and restore is an important function of phpMyAdmin, in the restoration of the database often encountered such a situation: phpMyAdmin restore the database when the maximum upload limit: 2,
I have passed a small test to check which function was faster to create a new file.
File_put_contents vs Touch
Copy the Code code as follows:
for ($i =; $i {File_put_contents (' Dir/file '. $i, ');}?>
Average time:0,1145s
Copy the Code code
The 1,filesize () function returns the wrong value.
When you download a page locally using curl, you need to read the contents of the temporary file TmpHtml.txt downloaded to a buffer. Because I use fread () to read, I need to pass in the size to be
How to use
Copy the Code code as follows:
$mysql = new Sqlstr ("Table1");$mysql->set ("name", "value");$mysql->set ("name", "1", true);echo $mysql->insertsql ();
Copy the Code code as follows:
Class Sqlstr{Private $param =array ();Private
When session sessions are turned on, a cookie that uniquely identifies session_id to the browser (named Phpsessid can be obtained via Session_name () is sent first, with Session.save_handler = Files, a file with no suffix is generated under the
Let Nginx support PathInfo
The Nginx server does not support PathInfo by default, and in programs that require pathinfo support (such as thinkphp), the URL "/index.php/home/index/index" cannot be supported.
There are many solutions to the spread
PHP Web page garbled is generally used in the establishment of the database Code and PHP Web page encoding different causes,
Database created with phpMyAdmin if you do not specify the encoding he is the default is LATIN1_SWEDISH_CI encoding, both
Copy the Code code as follows:
$foo = ' Bob '; Assign ' Bob ' to $foo$bar = & $foo; by $bar Reference $fooecho $foo. '';$bar = "My name is $bar"; modifying $bar variablesecho $bar. '';echo $foo. ''; The value of the $foo is also modified?>
PHP compresses HTML page code (clear spaces, line breaks, tabs, comment markers).
A good way is to compress the HTML, compressed HTML is actually: Clear line breaks, clear tabs, remove the comment mark. The role it plays is not to be underestimated.
Print variables or default values, this syntax automatically escapes HTML tags in variable content, making HTML tags output as they areWelcome, {{ $name or 'California' }}
Print the original contents of the variable without escaping the usage{!!
Prompt after installation under Windows:
Fatal error:trying to clone a Uncloneable object of class Imagick in C:\www\hx\pdf_to_png.php on line 17
This prompt is available with both IIS and Apache. After several tests, two solutions have been found:
I'm actually calling a Zend method of accessing the database, using the Fetchall method, but because there is no record in the database, the returned object is null, so I'll tell if the object is null:
Copy the Code code as follows:
if ($obj ==null)
I. Numeric data types
Numeric or numeric data is typically two types of double and int in PHP.
PHP is a loosely typed scripting language, paying attention to the way the type is converted.
Copy the Code code as follows:
$a = ' 5 ';A string of
PHP handling of case-sensitive issues is messy, writing code may occasionally problem, so here to summarize.
But I'm not encouraging you to use these rules. We recommend that you always adhere to the "case sensitive" and follow the Uniform Code
$TPL =new Smarty ();//Create a new Smarty object, I am using the Smarty-3.1.6 version
1. Set the Smarty template path $tpl->settemplatedir (); Templates by default
2. Set the Smarty template compilation Path $tpl->setcompiledir (); Templates_c by
This problem has been plagued for a long time, here to solve the problem, the key is the code on the coding problem.
The header.php of my page is encoded in the format of the Utf-8 BOM, and the BOM format code is modified to no BOM, so that the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service