PHP uses curl to determine if a remote file exists, see the code below:
Judging remote Files
function Check_remote_file_exists ($url)
{
$curl = Curl_init ($url);
Do not retrieve data
curl_setopt ($curl, Curlopt_nobody, true);
Send Request
$result =
Unfortunately PHP SimpleXML native does not support parsing of XML data with namespaces. For example, there are jiangzi XML data:
Mango Elementary Station
Do not know how to deal with, so disgusting a piece:
$content = "
Mango Elementary
Because of the limitation of the file permission of Sina SAE, the cache directory cannot modify the permission, so the original CodeIgniter cannot be used directly. You can try CodeIgniter 2.10 for sae:http://code.google.com/p/ci-sae/.
the
PHP generated thumbnail Image:
To use PHP to generate picture thumbnails, make sure your PHP server has the GD2 graphics library installed
Use a class to generate thumbnails of the picture, the source of the class is shown below
Call the method of
Usually we use Htmlspecialchars () to filter the HTML, but the HTML characters escaped, the final display is the HTML source code.
You can use Strip_tags () to get rid of HTML tags.
$str = ' href ';echo Htmlspecialchars ($STR);echo
There are several ways to codeigniter the HTML hazard code, the most common of which are the following:
1. You can choose to filter using the Htmlspecialchars () method.
2. $config[' global_xss_filtering ' = FALSE in the config.php file below the
PHP has a function similar_text (), which calculates two string similarity, and can draw a percentage to represent the similarity of two strings. The effect is as follows:
Similar_text (' aaaa ', ' aaaa ', $percent);
Var_dump ($percent);
Float (100)
We will use the Alexa website (or other webmaster Tools website) to check our website traffic rankings, so we must go to those sites. In fact, the Alexa XML API can be used to obtain the Web site Alexa-related data (XML format), and then use the XML
There is no doubt that design patterns in others in the system are multi-win; Design patterns make code production truly engineering; Design patterns are the cornerstone of software engineering, like the structure of a building.
single-case
Using PHP to crawl the content of the page in the actual development is very useful, such as a simple content collector, extract parts of the Web page, and so on, crawled content in the regular expression through the filter to get the content you
Interview Summary
Today, I went to the famous IT company in Beijing for a PHP programmer's interview. This is the first time in life, why not nervous? I'm not sick. No, it's called self-confidence.The first is to do some pen test.
What is the data
Share a way for PHP to traverse the directory and return the statistics directory size.Code:
Php$dirname= "Test1"; //mkdir ($dirname);//Traverse A level directoryfunctionListdir ($dirname) { $ds=Opendir($dirname); while($file=Readdir($ds)) {
This is a very good set of online document sharing system source code, imitation Baidu Library, bean Ding Document website source code, here completely free of charge for everyone to learn. Here without any currency can be downloaded to a lot of
PHP 5 has a complete reflection API that adds the ability to reverse engineer classes, interfaces, functions, methods, and extensions. In addition, the reflection API provides a way to remove document comments from functions, classes, and methods.
Thinkphp's
The F method can only be used to cache simple data types and does not support expiration and cache objects。 The S () cache method supports the validity period, also known as the dynamic caching method, using the following example:
Copy
Recently received a project by the hospital to do PHP research and support project development. Previously, there was no contact with PHP, here to get an idea of getting started.
1. PHP
PHP, hypertext preprocessor, hypertext preprocessor, a common
PHP uses the Fgetcsv () function for data in CSV format.
Use the following statement
$hd =fopen (' test.csv ', ' R ');
$buf =fgetcsv ($HD, 1000, ', ');
Opens a Test.csv formatted file with the contents of the file separated by the "," number.
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