PHP Address bar to pass Chinese $_get down after garbled, UrlEncode and UrlDecode usage detailedURL encodingSyntax: string urlencode (String str);return value: StringFunction type: Encoding processingFor example:
Copy Code code as follows:
The internet today, Ajax is not a strange word. Speaking of Ajax, you may immediately recall the XML that arose as a result of RSS. Admittedly, XML is a very good way to store data, but its flexibility precisely causes the difficulty of its parsing.
Method One:
In PHP, the Web site that captures HTTPS prompts the following error content:
Warning:file_get_contents () [function.file-get-contents]: Failed to open stream:invalid argument into i:webmyphpa.php on L INE 16
Open php.ini file Find;
PHP developers should be aware that PHP has a lot of built-in functions, mastered them, can help you do in PHP development more handy, this article will share 8 development of the necessary PHP features, all are very practical, I hope you can master
Using the regular expression of PHP to implement:
$content = ' Here is the content of the article, insert here a picture test ';
$content = Stripslashes ($content);
$img _array = Array ();
Match all remote pictures
Preg_match_all ("/(src|
After upgrading the VPS, due to the compatibility problem of Ubuntu upstart and OpenVZ, the SSHD service does not start automatically, after attempting veportal console and File Manager and submitting technical support can not solve the problem.
The PHP jump, that is, redirecting the browser to the specified URL, is a very common feature. This feature also has some detail requirements, such as how many seconds to wait for the jump, with no JavaScript implementation jump, and so on. The
The following section of code to introduce PHP parameter filtering
Class mysafe{public $logname;
Public $isshwomsg;
function __construct () {set_error_handler (' myerror ', e_all); -----} function Myerror ($errno, $errstr, $errfile,
1. Does not turn to the Italian HTML entitiesA basic common sense: all untrusted inputs (especially the data submitted by the user from form) should be transferred before the output.
echo $_get[' Usename '];
This example is likely to output:
This
Upimages.class.php PHP Upload Class
Copy Code code as follows:
Class Upimages {
var $annexFolder = "Upload";//Attachment storage point, default: Annex
var $smallFolder = "small";//thumbnail store path, note: Must be a subdirectory
ISU is the meaning of the case, where s also does not include line breaks and U is reversed the number of matching numbers so that it is not the default repetition, presumably this is the individual we read the article.
Regular back/(. *)/isu, what
PHP extracts the birthday date in the ID number and a function to determine whether it is adult. Can be determined at the same time 15-bit and 18-bit ID card, by my own test, very useful, sharing function code is as follows:
date ("Y") | |
The socket server works in such a way that it runs uninterrupted to wait for the client to connect. Once the client is connected, the server adds it to the customer list and then starts waiting for the message from the client.
Do not go away, the
Clear out a section of hyperlinks in HTML text The most common wording can be as follows:
Copy Code code as follows:
$str =preg_replace ("/]*href=[^>]*>|]*>/i", "", $content);
1. Delete hyperlinks in HTML text content
Copy
The project needs to do a weekly reporting function, you need to know the start date and end date of the specified number of weeks in order to handle other business. Here's a section of code that uses PHP to get the start and end dates of each week
With the widespread development of object-oriented programming, object-oriented display of many interesting problems. It is believed that many beginners will be exposed to two functions, constructors and destructors when learning php object-oriented
18. Fleet Activities (flyingfleethandler.php)
In the previous article we have initially studied the source code of the fleet activity, mentioned the trigger of the fleet activity. Now I am further analyzing the fleet activities in Xnova, which are
Form form for HTMLUsing HTML forms to simulate a POST request for a file upload, the code is as follows:
file upload
Send This file:
Attention:
To make sure that the File
The representation of a float type can have several of the following:
Copy Code code as follows:
$a = 1.234;
$b = 1.2e3;
$c = 7E-10;
?>
What you need to be aware of with PHP's float type is that there is a problem with the accuracy
1, UTF-8, GB2312 are supported by the Chinese character intercept function
Copy Code code as follows:
/*
Chinese character interception function supported by Utf-8 and gb2312
Cut_str (string, intercept length, start length, coding);
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