Introduction to PHP
PHP is a server-side scripting language for creating dynamic Web pages. Like ASP and ColdFusion, users can mix PHP and HTML to write Web pages, and when a visitor browses to the page, the server first processes the PHP commands
Copy Code code as follows:
Class session
{
Static $sessionObject;
/* $_session[' user '] = = 0, don ' t work.
* = = 1, he is really user.
*/
Private Function __construct ()
{
if (! (Isset ($_session[' user ']) && $_session[' user ']==0)
1.php function
1. User-defined Functions
Copy Code code as follows:
function name ([$parameter, [,...]])
{
function code
}
Note: The function name cannot be the same as a system function or a function that the user has
Interview Question 1
1, use PHP to print out the day before the format is 2006-5-10 22:21:21
2, Echo (), print (), Print_r () difference
3, can make HTML and PHP separated from the use of templates
4, how to implement PHP, JSP interaction?
5. What
If you will only use Frontpage, Dreamweaver WYSIWYG editing mode to write the Web page, and completely do not understand the syntax of HTML, I am afraid that the first point to understand the HTML syntax, in order to successfully write PHP program.
Some little things can be used sometimes!
1. Get Client IP Address
function GetIP () {
if (! empty ($_server["http_x_forwarded_for"])) {//Use agent case
$tip = Split (",", $_server["http_x_forwarded_for"]);
$CIP = $tip [0];
}
Else
$cip =
Here are the introductions.
1. Echoecho is a keyword in PHP that does not return a value. In writing, it can omit the parentheses. The following code:
Copy Code code as follows:
Echo ' Test String ';
Echo (' Test String ');
Pear is a php extension and application library that contains a number of useful classes, and after installing php5.0, pear is not actually installed, and the installation method is as follows:
1. Double-click Go-pear.bat in the PHP directory.
2.
Many times, we register personal information online, after submitting the page, always wait for the page refresh to tell us whether the registration is successful, encounter network bad, if registered a large list of things, after a long wait page
This article describes the PHP version of the micro-letter store API two times development and use methods. Share to everyone for your reference, specific as follows:
1. weixiaodian.php page:
id = $ID;
$this->slogisticslist ();
The
In PHP, use header ("location:test.php") to jump to note the following points:
1, location and ":" No space between the number, or there will be errors.
2, in the use of header can not have any output, including the page included in the label "?>"
This example for you to share the PHP use of the GD library for the image of the method of adding watermarks for your reference, the specific contents are as follows
Effect Chart:
The above is the entire content of this article, I
The usage difference between PHP time and date dates
1. Time () function
The time () function in PHP, using the echo output, is a very long integer that contains the date and times and is a computed value. If you want to get a date format such as
Today's Internet, collection site is very much, many sites like hotlinking/Steal other people's Web site pictures, so not only violate the network rights, but also caused by the hotlinking of the site to consume a lot of traffic, to the server
The Nginx rewrite of Yii
The following is the rewriting of Nginx Yii
server {set $host _path "/data/site/www.jb51.net";
Access_log/data/logs/nginx/www.jb51.net_access.log main;
server_name jb51.net www.jb51.net;
Root $host _path/htdocs;
Set
Before you wrote some PHP-like functions, here's a print_r () function with the following code:
Copy Code code as follows:
function PR (t, name, indent)
Local tablelist = {}
function Table_r (t, name, indent, full)
The local id = not
Before I gave a page to show the MySQL record class, but did not give the use of the example, now, I have just written an online auction system framework program to illustrate the use of this class, but also on the online auction implementation
We often have to make a number of choices for the user to process, such as allowing users to select multiple items of list items after the deletion of the selected items. Here's an example of how PHP and JavaScript deal with multiple choices,
Obtaining PHP
This section has details about PHP download locations, and OS issues. 1. Where can I get php? 2. Is there a precompiled binary version? 3. Where can I get an optional PHP expansion library? 4. What can I do to make these libraries work?
If the lookup succeeds, the remainder of the string is returned (from a matching point) and False if the string is not found.
Version support: PHP 3+
Grammar:
Stristr (String,find)
Description
String required. Specify the string to be searched
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