object-oriented Programming of PHP Learning notes

The code is as follows Copy Code Class DB {Private $mysqli; Database connectionPrivate $options; SQL optionsPrivate $tableName; Table namePublic function __construct ($tabName) {$this->tablename = $tabName;$this->db ();}Private

PHP uses regular filter links, tags, spaces, line breaks

Strip_tags function Strip_tags---To remove html and PHP tags from strings Syntax: string strip_tags (String str [, String allowable_tags]) Cases The code is as follows Copy Code $text = ' test paragraph. other text

PHP File upload Simple instance code

if ($_files[' file ']) {// ----------------------------------------------------------------------------------------------////Description: File Upload date: 2004-5-2//// ---------------------------------------------------------------------------------

JS Tree menu (PHP ajax can be refreshed)

The code is as follows Copy Code simpletree dragBody{Font:normal 12px Arial, Tahoma, Helvetica, Sans-serif;margin:0;padding:20px;}. simpletree{margin:0;padding:0;/*Overflow:auto;width:250px;height:350px;Overflow:auto;border:1px

10 days to learn the eighth day of PHP

Learning Purpose: Make a paging display The key is to use the limit in the SQL statement to qualify the displayed records from several to several. We need a variable $page that records the current page and a total number of records $num For $page

PHP Gets the relative path instance code

The code is as follows Copy Code function Getrelativepath ($a, $b) {$returnPath = Array (dirname ($b));$arrA = explode ('/', $a);$arrB = explode ('/', $returnPath [0]);     for ($n = 1, $len = count ($arrB); $n     &nb sp;   if

PHP Character Matching code

/*String A: "1,3,4,5,6,7,8,9,10,11,12,14,15,17,20,22,123,457",For example, I would like to know if this string contains "2", this Time "12", "20", "22" and so on*/One The code is as follows Copy Code if (In_array (' 2 ',

The value of PHP Web services

As far as I know, the Web Service Is the coolest technology, but it will eventually make everyone feel boring. I don't know how you feel, and every time I attend a lecture on Web services, I always hear many abbreviations, such as rest,

The configuration of PHP virtual machine

Namevirtualhost *:8001 ServerAdmin test@janabiz.com DocumentRoot D:projectsmobilejudgewebapphtdocs ServerName lyd.mobilejudge.com ErrorLog LOGS/ERROR_LOG.MJ Customlog LOGS/ACCESS_LOG.MJ Common Php_flag output_buffering on Php_value Output_handler

PHP Regular Expressions (. *) and (. *?) Difference

When a regular expression contains a repeating quantifier (such as: *,?, +), the usual behavior is to match as many characters as possible, such as: a (. *) b to match the Aabab string, which matches the entire string, which is called a greedy match.

Questions about how php extended programming returns arrays

I found the answer at zend.com and provided a group of examples, download here: http://www.zend.com/apidoc/examples.tar.gzReturns an array.PHP_FUNCTION (array_experiments){ Zval * new_element;MAKE_STD_ZVAL (new_element );Array_init (return_value

Php ajax XMLHttpRequest POST instance code

The code is as follows:Copy code The code is as follows:Copy code Ajax POST Real POST Person info will be listed here. Php codeHeader ('content-Type: text/html; charset = utf-8 ;');Echo "POST data:". implode ('', file ('php: // input '))

Php google map application instance code

Function selected ($ param, $ value ){If ($ param = $ value) print "SELECTED ";}# Collect any form data to control the display$ Scale = 10;$ Maptype = "G_NORMAL_MAP ";If ($ _ REQUEST [scale]) $ scale = $ _ REQUEST [scale];If ($ _ REQUEST [maptype]) $

Using php to generate thumbnails [recommended]

Function ResizeImage ($ im, $ maxwidth, $ maxheight, $ name ){$ Width = imagesx ($ im );$ Height = imagesy ($ im );If ($ maxwidth & $ width> $ maxwidth) | ($ maxheight & $ height> $ maxheight )){If ($ maxwidth & $ width> $ maxwidth ){$ Widthratio = $

How to correctly configure the Nginx + PHP environment

Suppose we use PHP to implement a front-end controller, or simply put, it is a unified portal: Send all PHP requests to the same file, and then implement routing by parsing "REQUEST_URI" in this file.At this time, many tutorials will teach you how

Php simple registration code

The code is as follows:Copy code user registration last name: Password: Confirm password: email: Telephone: address: The code is as follows:Copy code // Initialize the sessionSession_start ();// Contains the database tutorial

Php paging code and paging principle

/*Paging is very simple. Next we will mainly talk about paging principles and implementation methods.*//*In this way, we can know several pages.For example, if the result of a list is 126 rows and 20 rows on one page are divided into 7 pages,

Php entry-level file upload code

The code is as follows:Copy code Header ("content-type: text/html; charset = utf-8 ");?> // Uploadaction. php The code is as follows:Copy code Header ("content-type: text/html; charset = utf-8 ");If (! Empty ($ _ files ))  {$ Date = date

Regular expressions matching URLs in php

URI is the type of resources available on the Web-HTML documents, images, video clips, programs, etc.-are located by an Uniform Resource Identifier ("URI.Grouping:^ ([^ :/? #] + ):)? (// ([^ /? #] *)? ([^? #] *) (? ([^ #] *)? (#(.*))?12 3 4 5 6 7 8 9

Total Pages: 12780 1 .... 11738 11739 11740 11741 11742 .... 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.