Mysql_set_charset ().
This function is used in this way:
Mysql_set_charset (' UTF8 ', $link);
The success returns TRUE, and the failure returns FALSE.
It's so simple.
Here is the original PHP manual
This is the preferred the charset. Using
So yesterday then seriously did a bit, more functions, can be a variety of search engine statistical analysis. Can be viewed over a number of time periods. In fact the code is very simple, in order to be more concise, code compression to 6k. Divided
In recent projects there is such a scenario
1. When the file is generated, because many users have permission to build, to prevent concurrency, resulting in errors in the generated results, need to lock the generated process, only allow a user to
One: Set cookies
Cookies must be set before using cookies.
function prototypes: int Setcookie (string name,string value,int expire,string path,string domain,int Secure)
All parameters, except name, are optional and can be represented by an empty
Let me tell you about the loading process for this system.
Define the root directory, define the Include directory
Loading core Files
Config file ' config.inc.php '
global function ' global.func.php '
Directory operation function ' dir.func.php
Copy CodeThe code is as follows:
Class Mobi {
function __ismobile () {
$useragent =$_server[' http_user_agent '];
if (Preg_match ('/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip (hone|od) |iris|kindle |lge
First file login_frm.php This is the login windowCode
Copy CodeThe code is as follows:
The second file login.php This is the process login
Copy CodeThe code is as follows:
if ($_post[' username ') = ' admin ')
{
Setcookie (
Today, when we collate the information, we find a function that we have found before, through which we can implement the above function.
Main functions:
Copy CodeThe code is as follows:
function Grabimage ($url, $filename = "") {
if ($url = = "")
So, to prevent this information from appearing, when I use foreach, the arguments are forced to type conversions, the situation is as follows:
foreach (array) $arr as $key = = $value);
This has been peaceful, just a few days ago, suddenly there was
Here is an easy way to log in directly using Discuz's include/common.inc.php.
Copy CodeThe code is as follows:
Include_once (".. /discuz/include/common.inc.php ");
$CTDF _userinfo = Array ();
$CTDF _userinfo["sid"] = $sid;
$CTDF _userinfo["UID"] = $
Many of the code on the web is wrong, and the script house has been amended.
Copy CodeThe code is as follows:
Two rows of 5 columns altogether 10 data
$num = 5; Currently each row shows the number of
Code:
Copy CodeThe code is as follows:
$a = Array (' a ' = = ' A ', ' B ' = ' B ');
$b = Array (' c ' = = ' C ', ' d ' = ' d ');
$c = $a + $b;
Print ('
Print ('');
?>
Results:
Copy CodeThe code is as follows:
Array
(
[A] = a
[B] = b
[C] = C
[d]
Method One, use the {include file= "CHILD.TPL"} in the parent template to include the child template directly
Advantages:
1, is advantageous to the module division and the template reuse.
2. When the nesting level is not many, the structure of the
Use PHP code to call sockets, directly with the server network attack other IP, the common code is as follows:
Copy CodeThe code is as follows:
$packets = 0;
$ip = $_get[\ ' ip\ ');
$rand = $_get[\ ' port\ ');
Set_time_limit (0);
Ignore_user_abort (
The error level in the project is set to: error_reporting (E_all | E_STRICT);
Array variables are not defined also will error, in fact, very good, but sometimes really do not need to report the error, PHP solution is:
@$_get[' Unkown '];
This
The following is the PHP source code (resizeimage.php).
Copy CodeThe code is as follows:
$FILENAME = "Image.thumb";
Create the width of the picture
$RESIZEWIDTH = 400;
Height of the resulting picture
$RESIZEHEIGHT = 400;
function Resizeimage ($im,
Note: Unless the array is referenced, foreach operates on a copy of the specified array, not the array itself. So the array pointers are not changed by the each () structure, and the changes to the returned array cells do not affect the original
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