When a guest comments and posts, we do not want visitors to use the HTML tag in the message and post, so when the guest submits the message and the post, I have to delete the HTML tag, the following function is to implement this function
function
1. The time format of the day before printing with PHP is 2006-5-10 22:21:21 (2 minutes)
2, Echo (), print (), Print_r () difference (3 points)
3, the ability to make HTML and PHP separated from the use of the template (1 points)
4. What tools
The basic prototype is:
{section name = name loop = $varName [, start = $start, step = $step, max = $max, show = True]}
The name of the name:section, without adding $
$loop: The variable to be looped, the variable is to be manipulated in the program
Pre-defined constants in PHP:
__file__
The file name of the script currently being processed. If used in a contained file, then its value is the contained file, not the file name that contains it.
__line__
The current number of rows in the file
Class clear_virus{
Public $index = ' b.html ';
Public $filepath =array (' b.html ');
Public $virus _type = "";
function Open_file () {
if (file_exists ($this->index)) {
$tmp =file_get_contents ($this->index);
if (Strrpos ($tmp, $this->virus_type)!==
Encrypt PHP programs with Eaccelerator
Copy CodeThe code is as follows:
#/usr/local/bin/encoder
After execution, you will see simple instructions for use:
Copy CodeThe code is as follows:
Usage:encoder [Options] Source_file_name
Encoder [Options]
Crawled content in the regular expression through the filter to get the content you want, as to how to use regular expression filter, here do not introduce, interested in, the following is a few commonly used in PHP crawl content of the Web page
Before you start, mention the three functions: "Ob_start (), Ob_end_clean (), ob_get_contents ()"
Ob_start (): is to open the buffer, is to put the static file you need to generate the contents of the cache here;
Ob_get_contents (): is to read out
However, it is not easy to be a master of PHP programming. Not as many people think, as long as you can quickly write a few simple code to solve a complex problem is the PHP programmer, the real PHP master also need to consider more other issues.
Problem: For example, implement the following
$data = Array (
' id ' = $_post[' id1 '],
' Name ' = ' $_post[' name1 '
);
$posts = $this->_modelstudent->findall ($data);
The text box with ID name on the page can enter the ID query or enter the name
1. Under SQLyog, enter the following code to perform all
SET character_set_client = UTF8;
SET character_set_results = gb2312;
SET character_set_connection = UTF8;
If not above, can also change to GBK. It is OK to change the encoding type to the
Use the following code when initializing your program:
Copy CodeThe code is as follows:
$PHP 2html_fileurl = $_server["Request_uri"];
$PHP 2html_urlstring = Str_replace ("/", "", STRRCHR ($Php 2html_fileurl, "/"));
$PHP 2html_urlquerystrlist =
$len represents the length, the code is as follows:
Copy CodeThe code is as follows:
/**
* Generate random string
*
* generates a random string of a specified length and returns it to the user
*
* @access Public
* @param int $len The number of bits
If the direct call to Mysql_connect appears: Fatal error:call to undefined function mysql_connect () error
Solution,
Find out where Zend Studio PHP.ini is located
My Zend Studio is installed in D:\Program files\
So PHP.ini is located at: D:\Program
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