Let's take a look at the following examples:
/* Define data */
...Char * msg1 = "testtest ";Char * msg2 = "test ";Int Len = 20, T = 1;...
1 -----> If (strlen (msg2)> = strlen (msg1)... // right
2 -----> If (strlen (msg2)-strlen (msg1)> = 0)..
Really bored, whim, want to put the PHP inside part already provide encapsulated function re-use PHP implementation again,So the following code is mainly implemented in PHP part of the string processing function, while the implementation of some
There are three files:The first is: zcyh. php (Registered User Name) current location: homepage registration page Set the User name: ( 3-15 characters ) & Lt; td width = "42%" & gt; User name: & Lt; td width = "58%" & gt; note: a
PHP authentication functions. Copy the code as follows :? Php calculates the ID verification code according to national standard GB11643-1999functionidcard_verify_number ($ idcard_base) {if (strlen ($ idcard_base )! 17) {returnf
The code is as
? This program is used to parse articles copied by the NPC. Editor: Kong Xiuxiang. Date: 2001410 switch ($ position) {default: session_start (); if (! Isset ($ auth_passed) {echo this function can only be used by authorized users .; Return-1;} if
Basic data structure algorithm .? -------------------- Basic data structure algorithm ------------------ binary search (find an element in the array) functionbin_sch ($ array, $ low, $ high, $ k) {if ($ low $ h
//--------------------
// Basic data
//--------------------
Basic Data structure algorithm
//--------------------
Binary lookup (Find an element in an array)
function Bin_sch ($array, $low, $high, $k) {
if ($low $mid = Intval (($low + $high)/2);
if ($array [$mid] = = $k) {
return $mid;
Really bored, whim, want to put the PHP inside part already provide encapsulated function re-use PHP implementation again,
So the following code is mainly implemented in PHP part of the string processing function, while the implementation of some
PHP Tutorial convert BMP format picture to JPG format program
function Imagebmp ($img, $file = "", $rle =0){
$colorcount =imagecolorstotal ($IMG);
$transparent =imagecolortransparent ($IMG);$istransparent = $transparent!=-1;
if ($istransparent)
The user's detailed registration and judgment, read the user's detailed registration and judgment, there are three Files: The first is: zcyh. php (registered user name )? Include (header1.inc. php )? Divalign = centertablewidth = 89% border = 0tr &
? // This program is used to parse articles copied by the NPC. // Editor: Kong Xiuxiang. Date: 2001/4/10 switch ($ position) {default: session_start (); if (! Isset ($ auth_passed) {echo this function can only be used by authorized users .; Return-1;
// Simple decryption function (corresponding to the php_encrypt function) // simple encryption function (corresponding to the php_decrypt function) // simple decoding function (corresponding to the php_encode function) // simple encoding function
Ask a question about string truncation. Which of the following experts can help me read a function if I can't get PHPcode for a long time? & lt ;? Phpfunctionglstrlen ($ str) {$ tmp_arrayexplode (& quot;, & quot;, $ str); if (strlen ($ str) & gt; 30)
Sort out some of the previously written algorithms and string processing functions. This is just for learning.
Author: heiyelurenBlog: http://blog.csdn.net/heiyeshuwuDate:
//--------------------// Basic Data Structure Algorithm//--------------------
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.