Two-dimensional arrays are often encountered in PHP development, but his ranking is not as convenient as a one-dimensional array with built-in functions, the order of two-dimensional arrays needs our own Write function processing, here Uncletoo to
Today I came across a question about the memory allocation of PHP variables, recorded.
The following code:
Copy Code code as follows:
$a = Array (
' Str ' => 1,
' Child ' => 2
);
$b = $a;
$b [' child '] = $a;
$b ['
Introduction to PHP Filter
The PHP filter is used to validate and filter data from unsecured sources, such as user input.
Copy Code code as follows:
Remove HTML tags, or remove coded special characters
Var_dump (Filter_var (" Chinese
1. Remove all HTML elements, or keep a few HTML tags
Copy Code code as follows:
$text = ' test paragraph. other text ';
echo Strip_tags ($text);
echo "/n";
Allow and Echo strip_tags ($text, ' ');?>
The result is (minus
PHP Curl can simulate an HTTP request from the server side, such as crawling web pages, simulating landing, and so on. Depending on the option settings, you can get the response head and body in the curl_exec return results, but this does not
B.php's Code
Copy Code code as follows:
can only be accessed by post
if ($_server[' request_method '] = = ' Get ')
{header (' http/1.1 404 Not Found '); Die (' Pro, page does not exist ');}
Session_Start ();
$fs 1=$_post[' a '];
1. Create a php file, PHP code is as follows
PHP code saved to desktop, set to desktop
Create a new file desktopurl.php code as follows:
Copy Code code as follows:
.
Save for desktopurl.php, or you like to call him what name,
Strripos () function
Definitions and usageThe Strripos () function finds the last occurrence of a string in another string.If successful, the position is returned, or false.
GrammarStrrpos (String,find,start)
Parameters
Description
In the integration of HTML page inside the CI frame, loading css and JS failed, get a long time to find the CI framework is the framework of the portal, all the files in the framework of the request need to go through index.php processing, when
1. What is session?Equivalent to a client (can be browser, app, FTP and other, and the same browser open several more than a different client) to a server access, this period the server to create a unique logo (session_id session_name), In fact, an
1.php Pass value to JavaScript
The way PHP passes values to javascript: you need to quote outside the tag
document.getElementById ("Titor" +a+b). Innerhtml= "";
Note: In fact, originally I understand the error, PHP for dynamic display language. In
1, first you must generate the two-dimensional code specific code as follows:
Copy Code code as follows:
Class qrcode{
public $w;
Public $h;
Public $s;
function __construct ($w 1, $h 1, $s 1) {
$this->w = $w 1;
$this->h = $h 1;
1. Sys_getloadavg ()
SYS_GETLOADAVT () can obtain the system load condition. The function returns an array of three elements, each representing the average load of the system in the past 1, 5, and 15 minutes, respectively.
Rather than letting
The timing of server generation thumbnails is generally divided into two categories:
1. Generate when uploading files
Advantages: The upload has generated the required thumbnail, read without any need to judge, reduce CPU operations.
Disadvantage:
PHP generates a short URL
Principle:
1. The original URL do crc32 check, get the check code.
2. Use sprintf ('%u ') officers transferred Guevara code to convert to unsigned digits.
3.62 Operations for unsigned digits (uppercase and lowercase
Error Tip: Warning:session_start () [Function.session-start]: Cannot send session cache Limiter-headers already sent
Reason: error if there is output before session_start (),
Solution: add Ob_start () before Session_Start ();
index.php
Copy
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