English:
The code is as follows
Copy Code
function Tourl ($STR) {$str = preg_replace ('/[^a-za-z0-9]+/', '-', $str);$str = Trim ($str, '-');Return Strtolower ($STR);}
Contains special characters:
Author: Lao Wang
At present, the most successful framework in the PHP community is cakephp,symfony,zendframework, the choice is always good, but the choice is also a worry, is the so-called "two watch people never know the exact time." Today is
A simple example:News template file news_tmp.html:{title}{news_title}{news_image}
{news_content}______________________________________________________________________________________________Answer 7:News Generation file aaa.php:?Let's say the
Principle:
1. First calculate the size of the original picture2. Create translucent pictures of the same size3. Use the Imagecopy () method to merge the newly created translucent pictures with the original artwork
The code is as follows
If you also want to get the size information of the Flash file by parsing the SWF file header information, that's a bit far away. Since PHP 4 has been built into the getimagesize function to do this. Its function determines the size of any
In many development, we try to use header ("Content-type:image/jpeg") to output pictures, try to use some PHP image processing technology, make the output picture more intelligent and dynamic. But we often encounter new problems, unless you specify
The code is as follows:Copy code Function createimage ($ data, $ twidth, $ tspace, $ height ){$ Dataname = array ();$ Datavalue = array ();$ I = 0;$ J = 0;$ K = 0;$ Num = sizeof ($ data ); Foreach ($ data as $ key => $ val )
// Config. php// ================================================= User configuration area ==== ====================================$ Per = 1; // Number of images processed each time$ Dir1 = 'IMG '; // enter the Directory$ Dir2 = 'img2'; // the
The code is as follows:Copy code Class upfile {Public $ filepath = "www.111cn.net/"; // upload a file storage folderPublic $ filesize = 1000000; // size of the file to be uploaded// If you want to modify the file type that can be uploaded,
First answerThe most common answer is: Set the Session expiration time, that is, session. gc_maxlifetime. This answer is incorrect for the following reasons:1. first, PHP runs the session gc with a certain probability, that is, the session.
Both json_decode and var_export have the second parameter. I have never noticed it before. T_T. Besides, this var_export function is also the first time I know about it. The basics are still not solid.Json_decode(PHP 5> = 5.2.0, PECL json: 1.2.0-1.2.
1. Chinese interception: mb_substr ()Mb_substr ($ str, $ start, $ length, $ encoding)$ Str: string to be truncated$ Start: truncates the start point. The start point is 0.$ Length, number of words to be intercepted$ Encoding: webpage encoding, such
The initialization statement for adding time to the program: "date_default_timezone_set (" asia/shanghai ");Definition and usageThe date_default_timezone_set () function sets the default timezone used by all date/time functions.The
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