Use PHP to convert the URL string into a hyperlink (URL or email)

Copy codeThe Code is as follows:Function makeClickableLinks ($ text ){$ Text = eregi_replace ('(f | ht) {1} tp: //) [-a-zA-Z0-9 @: % _ + .~ #? & // =] +) ',' \ 1 ', $ text );$ Text = eregi_replace ('([[: space:] () [{}]) (www. [-a-zA-Z0-9 @: % _ +

PHP image size adjustment code

Copy codeThe Code is as follows:/*********************** @ Filename-path to the image* @ Tmpname-temporary path to thumbnail* @ Xmax-max width* @ Ymax-max height*/Function resize_image ($ filename, $ tmpname, $ xmax, $ ymax){$ Ext = explode (".", $

PHP transaction processing data implementation code

Copy codeThe Code is as follows:Public function insertUser ($ userArray ){Foreach ($ userArray as $ key => $ value ){@ $ Field. = "$ key ,";@ $ Content. = "'$ value ',";}$ Field = ereg_replace (', $', '', $ field );$ Content = ereg_replace (', $', ''

Use PHP to extract the FLASH Address Code from the video website page

Then I implemented this function using PHP. I think it is a pleasure to use PHP to do this job! With its powerful HTML page processing functions and regular expressions, you can use this function with just a few lines of code.Paste the key code:Copy

PHP Image Upload implementation code with detailed notes

Copy codeThe Code is as follows:// Upload the image processing fileIf ($ _ FILES ["file"] ["type"] = "image/gif ") | ($ _ FILES ["file"] ["type"] = "image/jpeg ") | ($ _ FILES ["file"] ["type"] = "image/pjpeg ")) & ($ _ FILES ["file"] ["size"] If ($

The question of string segmentation in Chinese/English mixed numbers in php

I searched for some time on the Internet and found that nothing happened.Later, I thought of a solution, which is original.Only use the intercept and replacement functions.Copy codeThe Code is as follows:Function smssubstr ($ string, $ length ){If

DedeCMS core class TypeLink. class. php abstract notes

Note: '// +' indicates additional comments added to me.Class TypeLink{Var $ typeDir;Var $ dsql;Var $ TypeID; // + category IDVar $ baseDir; // + site root URLVar $ modDir; // + template directoryVar $ indexUrl; // + home page urlVar $ indexName; // +

PHP Socket programming

The following code is used:PHP code:Copy codeThe Code is as follows:// Set some basic variables$ Host = "192.168.1.99 ";$ Port = 1234;// Set the timeout valueSet_time_limit (0 );// Create a Socket$ Socket = socket_create (AF_INET, SOCK_STREAM, 0) or

Php Smarty template generation html document Method

Directly send the code belowCopy codeThe Code is as follows:/*File: config_smarty.phpDone: Configure SmartyAuthor: www.5dkx.comDate: 2009-12-21*/Include_once ("../libs/smarty. class. php ");Class MySmarty extends Smarty {Function _ construct (){$

Php Upload function instance code

1. Upload the form upload.html Copy codeThe Code is as follows: 1. note this is a tag. to upload a file, you must specify it as multipart/form-data. Otherwise, the server will not know what to do.2.The Value is the hidden Value range of the form

10 uncommon but useful functions in PHP

1. sys_getloadavg () Sys_getloadavt () can obtain the system load. This function returns an array containing three elements, each representing the average load of the system in the past 1, 5, and 15 minutes.Instead of letting the server go down due

PHP code for capturing web images and saving them as images

The following are the source code and Related explanations.Copy codeThe Code is as follows:// The URL is the complete remote image address and cannot be blank. $ filename is the name of the saved image.// By default, images are stored in the same

Php + mysql authentication code

Copy codeThe Code is as follows:$ Uname = $ _ POST ["username"];$ Pwd = $ _ POST ["password"];$ Link = mysql_connect ('localhost', 'root', '123 ')Or die ('could not connect: '. mysql_error ());Mysql_select_db ('ruida ') or die ('could not select

PHP file reference skills

We know that java has the concept of a package, while. NET has a more convenient DLL Assembly reference concept, through these together in the form of packaging object set, we can easily reference classes or other objects defined elsewhere in our

THINKPHP + JS implement scaling image screenshot

Author: Yang xinqi Original: http://www.cnblogs.com/scotoma/archive/2010/03/05/1679477.html A big brother of the TP Forum joined me tonight and said that he also encountered this problem! Think about the fact that many things have been encountered.

Step by step learning PHP (2) -- PHP type

1. Case sensitivity PHP built-in functions and structures are case-insensitive.For example:Copy codeThe Code is as follows: HelloPHP Echo ("Hello PHP ");ECHO ("Hello PHP ");Echo ("Hello PHP ");?> The effect of the three is the same.Others,

DEMO code that uses cached APC on the same server is more efficient than Memcached

apc

Copy codeThe Code is as follows:$ Memcachehost = 'localhost ';$ Memcacheport = '000000 ';Function microtime_float (){List ($ usec, $ sec) = explode ("", microtime ());Return (float) $ usec + (float) $ sec );}Function runtime ($ t1 ){Return

GBK page outputs php functions in JSON format

Copy codeThe Code is as follows:Function tb_json_encode ($ value, $ options = 0){Return json_encode (tb_json_convert_encoding ($ value, "GBK", "UTF-8 ″));}Function tb_json_decode ($ str, $ assoc = false, $ depth = 512){Return

Php file garbled characters

The solution on the Internet is to use iconv () for transcoding after capturing. After reading this, I realized something was wrong: one is that the iconv library is not necessarily compiled, the bigger problem is that encoding is related to stream

Login Verification Based on pear auth

Create a page named yz. phpCopy codeThe Code is as follows:Require_once ('auth. php ');Function show_login_form (){Echo ' username: password: ';}$ Options = array ('dsn '=> 'mysql: // root: 1 @ localhost/zs ','Table' => 'users ','Usernamecol' =>

Total Pages: 12780 1 .... 12007 12008 12009 12010 12011 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.