/**
* Get city name based on IP address pure IP database
* edit:bbs.it-home.org
*/
function Convertip ($IP) {
IP Data File path
$dat _path = ' QQWry.Dat ';
Check IP Address
if (!filter_var ($ip,
* For now, avoid warnings of e_strict mode
* (This must is done before function definitions)
*/
if (defined (' e_strict ')) {
$old _error_reporting = error_reporting (0);
if ($old _error_reporting & e_strict) {
Problem Description:
When using PHP and Java to manipulate XML-RPC, if the request contains Chinese characters, it is automatically encoded into the following style:
Huan Huan.
Environment: PHP built-in XML-RPC's Api,apache java API
PHP folder operation function
String basename (String path [, string suffix])Give a string containing a full path to a file, this function returns the base file name. If the file name ends in suffix, then this part will be removed as well.In
Tree menu has a very wide range of applications in many desktop applications, the main advantage is that the structure is clear, so that users can very clearly know the location of their current. But the application of the tree menu on the Web
PHP pear and DB are used
// +----------------------------------------------------------------------+
// | PHP version 4.0
|// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2001 the PHP
Apache 2 and PHP are popular scenarios for creating interactive Web sites and are inexpensive. Installing Apache 2 in Windows is a breeze, but for PHP 4 to work seamlessly with Apache 2, you need some skill.
Turn from: Dynamic Web Authoring Guide
smtp.php
Copy CodeThe code is as follows:
Class SMTP
{
/* Public Variables */
var $smtp _port;
var $time _out;
var $host _name;
var $log _file;
var $relay _host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/*
In either language, string manipulation is an important foundation, often simple and important. As people speak, there is usually a form (graphical interface), a language (print string?). ), obviously the string can explain more things. PHP provides
It was the same thing the day before yesterday, but I couldn't remember. Just remember that date_sub (now (), ' Interval 1 days ') in MySQL;d ate (' y/m/d h:i:s ', mktime (' h '), date (' I ') , date (' s '), date (' m '), date (' d ') +1, date (' Y
If this official template explanation looks too abstract, you can refer to:
Parsing engine Overview Template Design specification code reference
Tag reference: Arclist (artlist,likeart,hotart,imglist,imginfolist,coolart,specart)
1. PHP Cookies
A cookie is a mechanism for storing data on a remote browser to track and identify users. PHP sends a cookie in the header of the HTTP protocol, so the Setcookie () function must be called before other information is exported to the
Integer can have 10 binary, 8 binary, 16 binary representation.
In octal notation, the number needs to start at 0 (0);
In hexadecimal notation, the number needs to be 0x (0 x) or 0X (0 caps X) to begin with;
Integer overflow: When an integer
1. At the end of each article in the article, top the ad position above the step,
The size of this position is 658*60 658 length do not change, 60 height can be arbitrarily changed
Ad code added here--backstage--template--Default template
Here's a look at the use of the database abstraction layer PDO:
PDO (PHP Data Objects) is a lightweight PHP extension that provides an abstraction layer of data access. Also, PDO can only be used in versions above PHP5.0.
Here's a look at the
Copy CodeThe code is as follows:
for ($i = 1; $i $str = str_repeat (' 01234567 ', $i);
$a = Memory_get_usage ();
Unset ($STR);
$b = Memory_get_usage ();
echo "\ n
". $i. ': '. ($b-$a). ' Bytes. ';
}
As seen from the results:
8 x 32 = 256 It is
PHP Development of friends know, in fact, the most worrying is that there are some exceptions or errors in the program, these conditions if the output to the user's screen will be frightened users, and even lost their work, if not output to the
1.PHP
a.php HTML & JavaScript
The amount is super simple, I also want to write = =~
In the HTML code
/>
in JavaScript code
Copy CodeThe code is as follows:
b.php MySQL
In PHP code
Copy CodeThe code is as follows:
$DBCNX =
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.