How does PHP batch detect and remove the file BOM header?
If (isset ($ _ GET ['dir']) {// sets the file directory
$ Basedir = $ _ GET ['dir'];
} Else {
$ Basedir = '.';
}
$ Auto = 1;
Difference between the PHP function addslashes and mysql_real_escape_string
Create table users (
Username VARCHAR (32) character set gbk,
Password VARCHAR (32) character set gbk,
Primary key (username)
);
Php-fpm executable file garbled solution
Cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
6/usr/local/php/etc/php-fpm.confCreate fpm startup service vi/etc/init. d/php-fpm and save
Php generates random strings (user-defined combination of numbers, letters, and numbers)
// Generate a random string
Function rand_zifu ($ what, $ number ){
$ String = '';
For ($ I = 1; $ I
Basic development knowledge: Php Basics
What is php?PHP is short for HypertextPreprocessor, and PHP script language is embedded in HTML. The PHP syntax is a unique mix of new c, Java, perl, and PHP syntaxes. The purpose of this language is
Writing pseudo-static rules in windows and linux
[Isapi_rewrite] # enable disguised static rules
Rewriterule/(%0-9%%%%.html/contents. php? W = $1 [I]
Any address starting with a number is transferred to contents.
Php string filter function example
Class request
{
Public function _ construct ()
{
If (! Get_magic_quotes_gpc ())
{
If (! Empty ($ _ POST ))
{
Foreach ($ _ POST as $ k =
Example of deleting an element from a php array
$ Arr = array ('A', 'B', 'C', 'D ');
Unset ($ arr [1]);
Print_r ($ arr );
?>
After unset is used, the array $ arr should compress the array to fill
Php Chinese character unicode encoding and decoding
// Encode the content in unicode format: yoka \ u738b (original: yoka King)
Function unicode_encode ($ name)
{
$ Name = iconv ('utf-8', 'ucs-2'
Php interview questions and answers
$ A = date ("y-m-d h: I: s", strtotime ("-1 day "));
Print_r ($ );
2. differences between echo (), print (), and print_r () (3 points)
Echo and print are not a
Small example of php string encoding conversion
Function phpcharset ($ data, $ ){
If (is_array ($ data )){
Foreach ($ data as $ key => $ val ){
$ Data [$ key] = phpcharset ($ val, $ );
Use details of the curlopt_postfields parameter in phpcurl
When curl is used to send some data to the server without looking at the details, the following results may be obtained. this is not the ideal result:
Example of php code conversion method
$ Content = iconv ("gbk", "UTF-8", $ content); // The first method is easy to use.
$ Content = mb_convert_encoding ($ content, "UTF-8", "gbk"); // avoid exceptions
// It is
Top ten traits of great programmers
How to become a good programmer has recently become the focus of our attention. The following are what I think we need most:Good at solving problems.It is both vigorous and lazy.Understand others'
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