Copy Code code as follows:
/**
* Remove HTML tags
*
* @access Public
* @param string str
* @return String
*
*/
function deletehtml ($STR) {
$str = Trim ($STR); Clear the spaces on either side of the string
$str = Strip_tags ($str, "");
A static variable exists only in a local function field, but its value is not lost when the program executes out of this scope. Take a look at the following example:
Copy Code code as follows:
function Test () {
static $a = 0;
$a + +;
This article is an example of the PHP file writing method to respond to multithreaded writing, the specific code is as follows:
function File_write ($file _name, $text, $mode = ' A ', $timeout =30) {
$handle = fopen ($file _name, $mode);
This example tells the PHP realization obtains the picture color value the method, the PHP obtains the picture color value detection picture main color is through the Imagecreatefromjpeg function reads the picture, then circulates obtains each color
This article describes the PHP judge GIF image is the method of animation, the following steps:
First, the GIF animation is gif89 format and finds the file at the beginning of gif89. But a lot of transparent pictures are also used in gif89 format,
PHP variable before add & symbol is not to say more, we are using, is two variables at the same time to point to an address, then, PHP function Plus & symbol of the meaning of what is it? Here are two demo codes before you explain.
function &
PHP File Upload
1, upload.php
Copy Code code as follows:
ddd
please fill in User name
please briefly introduce the file
please upload your file
2, uploadprocess.php
Copy Code code as follows:
Recently I from thinkphp ' Runtime_allinone ' learn from the experience: not afraid of the cache more, just afraid of the call chaos, simply will all the commonly used documents merged into a file, not beautiful ...
Copy Code code as follows:
Normally, we can use fseek to read, the advantage is not to read at once, the following code is only suitable for edge-edge processing, not suitable for one-time read one-time processing.
You can generate test files in the following ways
First open the httpd.conf file in the Apache Conf directory and add the following code at the end:
Copy Code code as follows:
ServerName www.mydemo.com
DocumentRoot "D:/mydemo"
Options followsymlinks includesnoexec Indexes
Copy Code code as follows:
PHP's current loop is 1, the loop is incremented from inside to outside, and the break defaults to 1, such as jumping out of the 2nd layer loop
For ($i =0 $i foreach (Array (1,2,3) as $val) {
foreach (Array (1,2,3)
Not how to use this new feature, in fact, is not new, try it, now static class inheritance is very convenient
';
Echo C::test ();
Echo ' ';
Echo B::test2 ();
Echo ' ';
Echo C::test2 ();
Echo ' ';
Echo A::test ();
Echo ' ';
Echo A::test2 ();
Simple_html_dom Plugin
A tool for processing HTML files with DOM
use:Load simple_html_dom.php File
Copy Code code as follows:
Require_once ' simple_html_dom.php '
New Simple_html_dom Object
Copy Code code as follows:
Now in retrospect, my previous thoughts were wrong, the process of Web page execution
Open Web page--load HTML code (including Css,javascript)-Execute PHP code-complete
The Rough covenant is first understood as above.
We all know PHP as a
Assetic is a PHP resource management framework for merging and compressing CSS/JS resources.
The sample code is as follows:
Copy Code code as follows:
Use assetic\asset\assetcollection;
Use Assetic\asset\fileasset;
Use
Have their own host general will design "anti-theft chain", in fact, including pictures of anti-theft chain, and download anti-theft chain, such as:1. Use. htaccess set up anti-theft chain
Copy Code code as follows:
Rewriteengine on
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