Do you have any idea of the principle?
Reply to discussion (solution)
/weibo common Interface Basic will need to Token/openid, which has been card off a large part of the water, and the high-level interface also requires authentication or
The project often requires some annoying functions, as developers should tidy up their own library of functions and copy them when needed. The author collects and collates the functions commonly used in dozens of PHP projects, ensuring that they
What is the approximate flow? Solving.
Reply to discussion (solution)
is the API interface
Write an excuse for the class is good ah, the data with Json_encode processing back
First, detect the current string encoding and change the encoding to Utf-8
1 Gets the encoding of the current string
$encode = mb_detect_encoding ($str, Array ("ASCII", ' UTF-8 ', "GB2312", "GBK", ' BIG5 '));
2 change character encoding to Utf-8
Refer to the online description, the description of the online content, organized in:
First of all, what does CGI do? CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI
fopen (),
r+
w+
It's all a read-write mode, isn't it different? Then why did you make 2 out of it?
It's best to write an example to see
Reply to discussion (solution)
R read-only opens, pointing the file pointer to the file header.The "r+"
Smarty
Smarty can be said to be the first open source framework that I have contacted with the PHP language, and with the help of Smarty, the project was well developed and the MVC pattern was well followed. But later, slowly found that many people
How do I get the timestamp of this week, last week, this month, the beginning and the end of the month
Reply to discussion (solution)
echo Date ("Ymd", Strtotime ("Now"), "\ n";echo Date ("Ymd", Strtotime ("1 week Monday")), "\ n";echo Date ("
$a = ' 36,0.00,0.00,100|37,0.00,0.00,100|38,0.00,0.00,100|39,0.00,0.00,100 ';
$b = ' 38 ';
$c = ' 85 ';
How to do a replacement with PHP ...
This means that when $ A contains the number of words in $b. Replace 100 in 38,0.00,0.00,100 with the
When you encounter this problem, characters that have spaces in the middle, when clicked, only go to the space before the character
So the data is not very accurate, how to better deal with, first thank you!
Reply to discussion (solution)
1, after the installation successful zookeeper, in the Zookeeper Bin directory has started the corresponding startup script
Start the server
./zkserver.sh Start
Start Client: (* Note: CLI requires Java installation)
zkcli.sh
2, php Example:
PHP upload file is the most basic of a technical point, but in-depth there are many problems to be solved, this does not, after uploading the Chinese file, the file name becomes garbled.
Here is the problem code, very simple:
1. Problem code
File_get_contents collects data from a page, gets the data is garbled, has used the method of detection encoding,
Detection is utf-8, my page encoding is also utf-8, but still show garbled, do not know why
$url = "xxx"; $opts = Array (' http '
I was originally an ASP. But the company made me discuz. So I came here to ask, no one to Discuz for help.
I made a single page, referencing the header and the bottom file.
Then, I want to do this: I want to find the corresponding div layer, and
Recently, due to the need to make an Android web app, you need to build a server, and develop dynamic Web pages, in order to improve efficiency, you install PHP plug-ins in eclipse, and can directly in eclipse to browse their own development of
PHP as a service-side Android, Apple as a client, PHP API interface should be designed to solve the new and old version and Android and Apple version inconsistency, 2. How to design the interface to ensure the scalability and flexibility of the
1. First we install the XHPROF:
Yum Install Xhprof
2. After installation, find xhprof configuration file xhprof.conf, usually in/ETC/PHP.D, add these 2 lines:
Extension=xhprof.soxhprof.output_dir=
This path refers to the folder
As you know, PHP currently has three cache plug-ins: APC, Eaccelerator, XCache, but they may all disappear in the future, because PHP 5.5 has integrated Zend Opcache, features similar to the first three but slightly different, Cache speeds are said
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