Fgets and fputs, fread and fwrite, fscanf and fprintf string read/write functions fgets and fputs
1. the fgets function of the string reading function reads a string from a specified file to a character array. the function is called in the form of
How to set php extension in linuxC
1. build a php environmentDownload php 5.2.6 source code and decompress it
Compile and install the php environment
2. create an extension project
Go to the source code directory
Cd php5.2.6/ext/
./Ext_skel --
Phpurl obtains parameters and port information. later, it was added by the network manager. after testing, it is a function code that can be directly used. It mainly obtains some information about the address bar, domain names, port parameters, etc.
In fact, the singleton mode has been applied in the factory mode. from the beginning to the end, there is only one factory, and the singleton mode does not need to create instances. Now let's write a simple example. Boat. php
The code is as
Obtain the remote image and save it to the local device.
//
// Function: obtain the remote image and save it to the local device.
//
//
// Make sure you have the permission to write files to the local server
//
//
// Variable description:
// $ Url
This is just the file that traverses the first-level folder. with a slight improvement of isdir (), you can traverse more multi-level folders;
The code is as follows:
// PHP traverses all files in the folder
$ Handle = opendir ('C: \ '); //
One of the powerful advantages of smarty is that it can directly use the prereserved variables of smarty in the template, saving a lot of code and making it very convenient. The following are examples of access page request variables such as get,
IIS supports php and asp. I believe it is favored by many people. the following configuration documents hope to help you build the php environment smoothly. if it is incorrect, please criticize it. phpmyadminZendOptimizer
In this example, under
To display the form data of CakePHP, first create the database cake_ext and execute the following SQL:
Create table 'companys '(
'Id' int (11) not null auto_increment,
'Company' varchar (50) not null,
'Price' decimal (8, 2) not null,
'Change'
The reserved variable {$ smarty} can be used to access some special template variables. The following are all the page request variables. The following are examples of access page request variables such as get, post, cookies, server, enviroment, and
The ClassOneDelegator proxy class is used to replace the ClassOne class to implement its method. The demo code is as follows:
The code is as follows:
Class ClassOne {
Function callClassOne (){
Print "In Class One ";
}
}
Class ClassOneDelegator
The following code is mainly about pseudo-static implementation, and search engines like the implementation of friendly URLs (vomit blood recommended)
Do you often see URLs of other sites like
Define a function to call FCKeditor and write it as a function in php to facilitate the call.
The code is as follows:
// Define a function to call FCKeditor
Function call_fck ($ input_name, $ input_value, $ w = '000000', $ h = '000000 ')
{
Curl_close, set of CURL function libraries in PHP-close a curl session
Curl_copy_handle-copy all content and parameters of a curl connection resource
Curl_errno-a number containing the current session error message is returned.
Curl_error-returns a
At the code level, that is, if you consider code security at the application level (that is, you do not consider vulnerabilities in the underlying language itself), the script security issue is the issue of functions and variables.
I. Preface
At
Base64 + gzinflate compressed (encrypted) files are usually? Eval (gzinflate (base64_decode (a php file in the header. The encoding and decoding code is given in this article. Base64 + gzinflate compressed (encrypted) files are usually
Compression
Php defines the domain name 301 to 301 redirection for all inner pages of the entire site
301 redirection (or 301 redirection, 301 redirection) is the header information in the HTTP data stream returned by the server when a user or search engine
Sometimes we need to control the expiration time of webpages such as the homepage. but for example, if we use Chinacache CDN, how can we design it so that it can cache my content?
Of course, you must first enable the reload_assist_ims on function
The following are some of the problems found by phper in actual writing. many other code needs to be optimized and many programs can be accelerated.
1. in a function, it is more efficient to use return when passing an array than to use global. for
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