This article mainly introduces three methods for php to send post requests, namely using curl, file_get_content, and fsocket to submit post data. For more information, see
The code is as follows:
Class Request {
Public static function post ($ url,
A simple dao that implements basic CRUD functions can inherit the dao class extended to the actual business, and can also be directly used.
The code is as follows:
// Require_once ('firephpcore/FirePHP. class. php ');
// $ Firephp = FirePHP:
Php sends emails. many related articles will be posted online. This article describes sending emails with attachments. if you do not know, refer to emailclass. php.
The code is as follows:
Class CMailFile {
Var $ subject;
Var $ addr_to;
Var $
Recently, PHP queries often encounter problems such as source #4 or source #5. Below is a good solution, you can try to perform a query using mysql_query ($ sql1), which is often caused by source #4 or source #5 when you write a query in PHP
This article mainly introduces a set of PHP reversible encryption and decryption algorithm instance code. if you need it, you can refer to the md5, sha1, and other methods for most password encryption. This can effectively prevent data leaks, but
This article mainly introduces the calendar created using php. for details, refer to it.
Calendar. class. php
The code is as follows:
Class Calendar {Private $ year; // current yearPrivate $ month; // The Current monthPrivate $ start_weekday; /
This article mainly introduces the example of php exception handling. the code illustrates how to capture and handle common and fatal errors. For more information, see
The code is as follows:
// Disable error output
Error_reporting (0 );
// Set
This article mainly introduces how to output html tables from php arrays. For more information, see
The code is as follows:
Class xtable
{
Private $ tit, $ arr, $ fons, $ sextra;
Public function _ construct ()
{
$ This-> tit = array (); // strings
This article mainly introduces the php format date example. For more information, see
The code is as follows:
// Format the date
Static function formatDate ($ format, $ datetime, $ week = 0 ){
$ Datetime =$ datetime> 3000? $ Datetime: strtotime
This article mainly introduces the php paging function sample code. if you need it, you can refer to the following example to share the php paging function code. using this function to implement paging code is good.
Code, php paging function.
The
To facilitate SEO, we need to record users' search keywords through common search engines. The following is the implementation code for accessing your website.
The code is as follows:
$ Rfr = $ _ SERVER ['http _ referer'];
// If (! $ Rfr) $ rfr =
This article mainly introduces the zf framework's example of session cycle and number limit. For more information, see
The code is as follows:
Require_once ("Zend/Loader. php ");
Zend_Loader: loadClass ("Zend_Session_Namespace ");
$ Session =
Delete an element from an array. I use unset directly, regardless of what happens after unset. However, what I saw today surprised me, not as I thought. I use examples to illustrate an example:
The code is as follows:
$ Arr = array ('A', 'B',
What is the scope of a variable? The scope of a variable refers to the valid range of the variable within one lifecycle of the script. In general, there are global and local differences. in PHP, the scope of variables can be divided into: Super
Ob, the output buffer, short for outputbuffering, rather than outputcache. When ob is used correctly, it can help with the speed. However, adding the ob function blindly only increases the CPU extra workload. The basic principle of ob is: if ob
When there are more and more comments on the website, the application of the paging function comes into being. in this article, we will focus on the call of the ThinkPHP built-in paging class in the ThinkPHP framework.
1. First, add the paging
This article mainly introduces the example of session usage in php. if you need a friend, refer to section 1. initialization. (you must use it before using session. you can use one page)
The code is as follows:
Session_start ();
2. Save
This article mainly introduces how to obtain the ID numbers of all sublevel and sunlevel columns in PHP. For more information, see
The code is as follows:
// @ Get the subtopic ID
Private function sonCategoryIds ($ categoryID)
{
// @
This article mainly introduces php sequential search and binary search examples. For more information, see
The code is as follows:
Class search{// Find the source arrayPrivate $ array = array (1, 2, 3, 5, 7, 6, 4, 8 );/*** Sequential search* @
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