PHP verification ID card favorites. Personal identity card functions are very useful, especially in the online survey, it is useful to verify the ID card in personal information. Personal identity card functions are very useful, especially in the
Security needs to be thoroughly understood and mastered, both in development and during interviews or technical discussions.
GoalThe goal of this tutorial is to give you an idea of how you should protect your own built WEB applications. Explains
ID card functions. I wrote several ID card functions, and I personally felt very useful. especially in the online questionnaire survey, it is very useful to verify the ID card in my personal information, but there are few applicants, I still wrote
PHP verification ID card favorites, read PHP verification ID card favorites, ID card functions, personal feeling very useful, especially in the network survey, the ID card in personal information verification is very useful, share it with you.
Must be Chinese, English, special characters can be achieved.
Utf-8 Chinese intercept, single byte intercept mode
function Cn_substr_utf8 ($str, $length, $append = ' ... ', $start =0) {
if (strlen ($STR)
Return ';
}
: My Forum source code 10: reguse. inc. php processes the information of registered users & lt ;? Functionregok ($ mess, $ reginfo) records the user information after successful recording. {echo & lt; tablecellspacing0cellpadding0bgcolor #000000
Php color conversion function hex-rgb (convert the hexadecimal format to the decimal format ). Copy the code as follows :? Phpfunctionhex2rgb ($ color) {if ($ color [0] #) {$ coloursubstr ($ color, 1);} if (strlen ($ color) 6) {list ($ r, $ g, $ B)
Php intercepts functions that contain the length of a mixed string
It must be a combination of Chinese, English, and special characters.
// UTF-8 Chinese intercept, single-byte intercept mode
Function cn_substr_utf8 ($
PHP development cannot violate security rules to filter user input. As the most basic precaution, you need to pay attention to your external submissions and make the first security mechanism to handle the firewall. Rule 1: never trust external data
Rule 1: never trust external data or enter information about Web application security. The first thing that must be realized is that you should not trust external data. External data includes any data that is not directly input by programmers in php
The URL completion function (FormatUrl) for collecting PHP articles ). The URL completion function is also called FormatUrl. This function is used to develop collection programs. when collecting articles, you will often encounter the path on the
The number of websites that have seen a Baidu thief reaches pr6. More than 100,000 !! After 40 days of provisioning, I found that Baidu is really friendly to this. I recently found that more and more versions are available to know and ask thieves !!
Rule 1: Never trust external data or input
The first thing you must realize about WEB application security is that you should not trust external data. External data (outside) includes any data that is not directly entered by the programmer in the
Look at the code first
function reverse ($str) { if (strlen ($STR) >0) { reverse (substr ($STR, 1)); Echo substr ($STR, 0,1); return;} } Reverse ("ABCDEFG");//GFEDCBC
In the above example, I think that understanding is a circular
Chinese intercept modifier.cn_truncate.php
Copy CodeThe code is as follows:
function Smarty_modifier_cn_truncate ($string, $strlen = A, $etc = ' ... ',
$keep _first_style = False)
{
$strlen = $strlen;
$string = Trim ($string);
if (strlen ($string)
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.