Summary of common string usage in php
Echo implode (",", array ('lastname', 'Email ', 'phone'); // Convert the array to a string
Explode:
Print_r (explode (",", 'lastname, email, phone'); // convert a
In include/global. func. php, The strip_ SQL function filters the passed values, but we can bypass this restriction to achieve full version injection.
function strip_sql($string) { $search = array("/union[\s|\t]/i","/select[\s|\t]/i","/update[\s|
Every programmer and developer likes to discuss their favorite code snippets, especially when PHP developers spend several hours coding for webpages or creating applications, they know the importance of these codes. To save coding time, the editor
This method is appropriate when the amount of data is large. When the binary method is used to find the data, it needs to be well sequenced. The main idea is: (Set the search array interval of array[low, High]) (1) to determine the median position
This title looks more like a detour, I directly on the code, such as the following a form of organized array
$a = Array ( ' key12 ' = = 12323, ' key32 ' = = 4345, ' key13 ' = 323423, ' key43 ' and 32423, ' key25 ' and '
In the character interception is often due to HTML format unexpectedly, ASP is, PHP (as the mainstream development language now) Also, if the simple HTML format is predictable with replace on the line, for the body of the article may contain all the
PHP filters various HTML tags and phphtml labels. PHP implements filtering various HTML tags. phphtml labels first share some common $ strpreg_replace (s * imgs + [^] *? Srcs * s * (| )(.*?) 1 [^] *? S * I, $ str); filter img tags $ str PHP to
Find the Duplicate numberTotal Accepted: 26713 Total Submissions: 68841 Difficulty: HardGiven an array nums containing n + 1 integers where each integer is between 1 and N (inclusive) , prove that at least one duplicate number must exist.Assume
"Problem description"The annual science Festival is about to come. Students enrolled in the list of activities to the Fonkshun headmaster that, the result of the headmaster a look wrinkled brow: This help students enthusiasm unexpectedly so high,
Php clears HTML code. When intercepting characters, it is often caused by exceptions in the HTML format. ASP is, php (as the mainstream development language) is also, if it is a foreseeable simple HTML format, use replace, for articles that often
Have analyzed the source of strtr before, now compare Strtr, str_replace and preg_replace efficiency:
Copy CodeThe code is as follows:
$str =
' 111111110000000000000000000000000000000111000001000100010000010010000010010000010100000010
';
$str = Str_
Query the number of touch fields in the array? $ R = mysql_query ('select & nbsp; orderid, zhuangtai, group_concat ('name') & nbsp; as & nbsp; name, group_concat ('shouji ') & how many fields does the nb search array contain?
$ R = mysql_query
////////
//
Zhangshulin-Hui Jia Studio
//
Module name:woods-bhtml.php
Abstract: Generating a static HTML handler end
version:2.0
Copyright 1001-1006, All rights reserved for Hui Jia Studio
The software for
I posted a post titled sending an original tool and downloading the autohome forum post for offline browsing, written in C # winform. Now I have a PHP version.
The analysis process is the same as the previous post, but PHPCodeTo achieve this,I
Copy CodeThe code is as follows:
/**
* One-dollar segmentation algorithm
* UTF8 encoding next character if the first character ASCII code is not greater than 192, it only accounts for 1 bytes.
* If the first character ASCII code greater than 192 is
Example, PHP gets Sina constellation and horoscope.
function Html2txt ($document) {
$search = Array (' @ @si ',//Strip out JavaScript
' @]*?> @si ',//Strip out HTML tags
' @
]*?>.*?
This post is mainly for all the phpers to their own in the development or learning of some of the experience and skills to summarize, mainly to solve a certain kind of thing better way to tell everyone.
I'll say a few first:
1, if you use echo to
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.