Array to JSON
The JSON object is turned into
The simplest way to use an array, or the Json_decode () method, is to write one more argument in the back to get it done.
Json_decode ($json, true);
This allows you to convert JSON to an array of
1. The MAGIC_QUOTES_GPC option in the PHP configuration file php.ini is not turned on and is set to off2. Developers do not check and escape data typesBut in fact, the 2nd is the most important. I think that it is the most basic quality of a web
The as well as the server and MySQL tutorials also need to tighten some security precautions. for Linux server security settings: Encrypt passwords, use the "/usr/sbin/authconfig" tool to open the shadow feature of passwords, and encrypt password.
After the configuration completes PHP, the default PHP will generate session into the/tmp directory, resulting in a lot of/tmp directory files, so the session needs to be periodically cleaned up:
Modify PHP.ini:
[Root@hz scripts]# grep
Let's take a look at how to use PHP to identify users through the PC, iPad or mobile phone to access the site?$uAgent = $_server[' http_user_agent '];$osPat = "mozilla|m3gate|winwap|openwave| Windows nt| Windows 3.1|95| blackcomb|98| me|
The code looks like this:
The code is as follows
Copy Code
To crop a picture in a large background picture, in the JPEG image format, as an examplefunction Cut ($filename, $x, $y, $width, $height) {$back =
The pcntl_fork () function creates a child process that is only PID (process number) and ppid (parent process number) different from its parent process. For more information on how fork works in your system, check out the fork (2) manual for your
The header is divided into three parts:
The first part is the HTTP protocol version (http-version);The second part is state code (status);The third part is the causal phrase (reason-phrase).
Header () Function usage Description:
First, the role:~~
。
The Odbc_exec () function is used to execute SQL statements
$db _user= "Dbuser"; Define connection user Name$db _pass= "Dbpass"; Connect the user's corresponding password$DSN = "DSN"; Defining DSN Data sourcesif (Odbc_connect ($DSN, $db _
$hostname = "localhost"; To define the MySQL server name to connect to$username = "root"; Define the user name to use for the connection$password = ""; Define the password to use for the connection$link =mysql_connect ($hostname, $username,
The configuration of LNMP or LNAMP environment is not described here, only the process of configuring multiple instances on the basis of a LNMP environment. Because I am using the lnamp environment, I compile an extra copy of PHP
Starting with version 5.2, PHP native provides Json_encode () and Json_decode () functions, which are used for encoding and decoding.
One, Json_encode ()
String Json_encode (mixed $value [, int $options = 0]): This function is primarily used to
A summary of the vulnerabilities in PHP website
Judging from the current network security, the most attention and contact with the most Web page vulnerability should be ASP, in this respect, small bamboo is an expert, I have no say. However, in PHP,
First, directly filtered out
$reg = Array ("\ r \ n", "\ n", "\ R");$replace = ";$str =str_replace ($reg, $replace, $STR);
So the content will not have to wrap.
Two, become a line wrap
Var_dump ($STR) Print the content out, see in the browser:
Sorting 2-D arrays or multidimensional arrays is a common problem, in PHP we have a special multidimensional array sorting function, the following briefly:Array_multisort (array1,sorting order, sorting type,array2,array3. is a function that sorts
Using MacPorts to configure the PHP development environment (php54+php FPM+NGINX+MYSQL55), you first need to install port, Access: http://www.macports.org/install.php, download the source code directly:
I. htmlentities () and Htmlspecialchars () 1, Htmlentities () 1.1 Features: Converts characters to HTML entities. Characters include ASCII entities and ISO 8859-1 entities (HTML entity tables: http://www.w3school.com.cn/tags/html_ref_entities.html) 1
1. ArrayThe array in the php Tutorial is actually an associated array, or a hash table. Php does not need to declare the array size in advance. You can create an array by directly assigning values. For example:// The most traditional method: Use
PhpMyAdmin lacks the mysqli extension. Check the PHP configuration solution:The mysqli extension is missing. Check the PHP configuration.Open your php. ini-> in the C: WINDOWS directory.Find The code is as follows:Copy code ; Extension =
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