PHP 3g{wap} Web site writing considerations

(1) the use of ";?" and "?>" to contain the WML program line written by PHP, in the form: ? ...... (program line); ?> (2) All other WML tags and statement lines are declared using the Echo keyword of PHP, followed by the newline character "n"

PHP Unlimited class [Recursive method]

$parent is the parent of the children we want to $level is increased when we go to the tree, deeper Used to display a nice indented tree function Display_children ($parent, $level) { Gets all the child nodes $parent a parent node $result =

PHP file Pagination Code previous page next page

function GETPAGEBREAKDM ($totalPage, $nowPage, $aid){Global $cfg _rewrite;if ($totalPage ==1){Return "";}$PageList = " altogether". $totalPage. " Page: ";$nPage = $nowPage-1;$lPage = $nowPage +1;if ($nowPage ==1){$PageList. = " Prev ";}Else{if

PHP File installation program three

$title. = ' management record ';$content. = ' ';$page = (isset ($_get[' page ')) && intval ($_get[' page ') >0)? Intval ($_get[' page ']): 1;$q _aop=sprintf (' Select A.*, B.name, B.photo from%s as a,%s as B where a.aid=b.id order by A.datetime ', $

PHP File Installation Tutorial II

md5

function WriteText ($f, $c) {if (is_writable ($f) | |!file_exists ($f)) {if (! $h =fopen ($f, ' W ')) return false;if (!fwrite ($h, $c)) return false;Fclose ($h);}else{return false;}return true;} function SqlString ($c, $t) {$c = (!GET_MAGIC_QUOTES_

PHP read Sogourank and Chinarank information

Function Sogourank ($domain) {   $rank = ';   $PR = 0;   $content = get_content (' Http://ww W.sogou.com/web?query= '. $domain);  if (Preg_match ("/ ([0-9]{1,}) /", $content, $matches))  {    $PR = Intval ($matches [1]);    $width = ceil (65* $

Take a string, PHP intercepts the Chinese string

function Moocutstr ($string, $length, $dot = ' ... ') {Global $charset; if (strlen ($string) return $string;}$string = str_replace (Array (' ', ' " ', ' '), $ string);$strcut = ';if (Strtolower ($charset) = = ' Utf-8 ') {$n = $tn = $noc =

Php Chinese garbled problem solution

1. Chinese garbled characters in mysql + phpThis problem occurs because the database connection and webpage encoding are inconsistent.SolutionWhen connecting to mysql, we will set a sentence later.Mysql_query ("set names gbk ");ExampleIn the

Incorrect date obtained by The php date function

Example.Echo $ showtime = date ("Y-m-d H: I: s ");10:44:47The real time is18:44:47From the above point of view, the difference is 8 hours. Baidu search found that the default time set for PHP is based on Greenwich Mean Time Zone. We only need to

Php Notice: Undefined index error solution

1. Locate undefined variables for processing The code is as follows:Copy code Addslashes (htmlspecialchars (isset ($ _ POST [$ str])? $ _ POST [$ str]: ''); 2. Filter out errors The code is as follows:Copy code @ $ Page = $ _ GET ["page"];

Php file Upload POST size exceeds modification method

Php configuration: The code is as follows:Copy code Upload_max_filesize = 200 M Nginx configuration: The code is as follows:Copy code Client_max_body_size 200 m; According to the above statement, I am not sure whether it is the limitation

PHP date function display explanation

For example, date ("Y-m-d H: I: s", $ t );. However, in this case, the correct time cannot be called up. If this value is null, the error-01-01 will be displayed.The problem is that the country $ t is an incorrect time cut. We only need to use $ t =

The php header () function prompts the file to be downloaded and cannot be opened.

Experiments show that the fread function can read a maximum of 8192 bytes at a time, that is, 8 kB. If you want to read a file larger than this size, you need to read it cyclically until the end of the file. Based on the above corrections, the

Mysql_query ("set names UTF-8") garbled characters in php

UTF-8 is used in mysql to indicate UTF-8, which is a type of encoding.In php, mysql_query ("set names UTF-8 & Prime;); because mysql defines utf8 instead of UTF-8, this statement cannot be executed, the effect is the same as that of mysql_query

PHP Curl function cannot be used in win7 (X64) system environment

I first removed the extension = php_curl.dll in php. ini and restarted the apache environment, but the following function is prompted when I call the following function: The code is as follows:Copy code // Initialize a cURL object$ Curl =

PHP substr intercepts Chinese garbled characters

ord

The description on the document page uses the substr function to intercept 220 characters, but the last Chinese character is always garbled and the length obtained is incorrect.The Magic Google method may be found because substr (string, start,

Solution to Memcached connection timeout in php

During a routine check log, we found that a large number of PHP connection Memcached timeout errors were found in the Nginx log, as shown below:PHP Warning: Memcache: connect (): Can't connect to 127.0.0.1: 11211, Connection timed out (110)

Php htmlentities Chinese character garbled Chinese problem solution

The htmlentities function may contain garbled characters when used in Chinese character variables. The code is as follows:Copy code $ ResultsText = str_replace ("[QUERY]", htmlentities ($ query), $ resultsText ); The correct method is to change

PHP generates CSV files and opens garbled characters in Excel

chr

Baidu found outPHP generate UTF-8 encoded CSV file with Excel open Chinese display garbled, is because the output CSV file does not have BOM.We just need to take a look.So how to output BOM in PHP?Before all content is output The code is as follows:

Add another port instance to the web server [apache + php]

Add another port instance to the web server [apache + php Tutorial]/*Find your apache installation directory and find the httpd. conf file,Search for # listen, and add The code is as follows:Copy code Listen 800.Listen 801.Listen 802. Here is

Total Pages: 12780 1 .... 9381 9382 9383 9384 9385 .... 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.