Code for PHP to intercept strings at a specified length

PHP intercepts the string's code at a specified length, and if the string exceeds the specified length, it will be used ... replacement, but this code does not support the distinction between Chinese and English If a string is

PHP Protection against SQL injection

!--? php /* Sometimes the form submits more than one variable, There could be more than 10, dozens of. Copy/Paste the addslashes () once and again, is it a bit of a hassle? Since the data obtained from the form or URL

Collection Collection class for PHP

Header ("content-type:text/html; Charset=utf-8 "); Class collection{ Private $_members=array (); Private $_onload; Private $_isloaded=false; Public Function Startload () { $this->_checkcallback (); }

PHP translates Linux runtime into a better-looking format

PHP translates Linux runtime into a better-looking format $exec = shell_exec (' uptime '); $uptime = explode (' Up ', $exec); $uptime = Explode (', ', $uptime [1]); if (Strpos ($uptime [0], ' Day ')) {

PHP Displays user-friendly time

Within a minute "just" within an hour "* minutes ago" today within "today's Hour: minutes" Yesterday "Yesterday Hour: Minutes" greater than 2 days "year-month-day hours: minutes" Format time function Format_date ($beforetime)

Example of PHP preventing remote submission of forms outside the station

In PHP Development (http://www.maiziedu.com/course/php/), in order to prevent the webmaster to submit a form is nothing more than every open form or submit data will need to add a token to verify, which is actually the same as the Verification Code

PHP calculates the distance between two points on a map

cos

Class Geohelper { /** * @param int $lat 1 * @param int $lon 1 * @param int $lat 2 * @param int $lon 2 * @param string $unit * @return */ public static function distance ($lat 1, $lon 1, $lat 2, $lon 2

Mysql_get_server_info () function

The Mysql_get_server_info () function is a PHP built-in system function.The Mysql_get_server_info () function returns information about the MySQL server.If successful, returns the version number of the MySQL server, or False if it fails.Syntax:

Empire CMS Message Board reply after sending email to notify customers

Copy Code--------------------------------------------------------------------------------------------------------------- ------Revision 2:e/admin/tool/gbook.php Add a line: Include (".. /.. /class/sendemail.inc.php "); Copy

Tutorials for configuring LNMP under the Debian system

LNMP environment configuration is required to let our host support Nginx, MySQL, PHP, PhpMyAdmin, so configured to use this environment directly, and run the site on the above, I will configure the method.We'll take a look at the official

PHP-based Water quality query API call code instance

Code Description: PHP-based water quality query API call code instanceAssociated data: Water qualityInterface Address: HTTP://WWW.JUHE.CN/DOCS/API/ID/34 // +----------------------------------------------------------------------// |

PHP Directory Copy Implementation method

This article describes the PHP directory copy implementation method. Share to everyone for your reference. Specific as follows: function Copy_dir ($SRC, $DST) { $dir = Opendir ($SRC); @mkdir ($DST); while (false!=

Zip compression code for PHP

$error = ""; Error holder if (Isset ($_post[' createpdf ')) { $post = $_post; $file _folder = "files/"; folder to load files if (extension_loaded (' Zip ')) {//Checking zip extension is available if (Isset ($post [' Files '])

PHP Algorithm instance sharing

Print only 0The specific number is determined by the input parameter nPrint 00000 as N=5 $n = $_get[' n ']; for ($i =0; $i echo "0"; } ?> Copy CodePrint a

PHP traversal deletes entire directory and files

We can use Recursivedirectoryiterator and recursiveiteratoriterator to delete directories and subdirectories and files, and subdirectories will first be deleted with the parent directory. function Cleanup_directory ($dir) {

PHP gets file size and file creation time

PHP can display various properties of a file, including the last access time of the file, the last modification time, the file size, and so on. Returning information about a file Print "The size

Recommended 4 open-source forums for learning PHP

PHP programming language popular from the idea of open source, PHP also has a lot of open source programs. Referring to the forum people think of May be PHP development (http://www.maiziedu.com/course/php/) Discuz and Phpwind forums, in fact,

Django Tutorial: Useful tips

Today we introduce some of the little tricks in the Django daemon in the Django Tutorial (http://www.maiziedu.com/course/python/307-3024/), and we all know that we just need to add less code to the Django backend. You can implement powerful features,

Long microblogging generation tool PHP source text based on the growth of micro-bo pictures

Error_reporting (7); Define (' ROOT ', GETCWD ()); Define (' BASEDIR ', Parse_url ($_server[' Request_uri '), Php_url_path)); if ($_post[' text ']) { $ret = Array (); $text = $_post[' text ']; try { $ret [' imgurl '

Use PHP to zoom in and out of images

function Resizeimage ($srcfile, $mySize) { $size =getimagesize ($srcfile); Switch ($size [2]) { Case 1: $img =imagecreatefromgif ($srcfile); Break Case 2: $img

Total Pages: 5208 1 .... 4769 4770 4771 4772 4773 .... 5208 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.