The main function is based on Beibei's date of birth to show Beibei now how big, real-time show beibei growth.
Use the current time minus the date of birth, but it can be shown how many years, months, and days.
The algorithm of the day is somewhat
This article is an example of the implementation of the search keyword in PHP site. Share to everyone for your reference. The specific analysis is as follows:
Our approach is to put the search results out, and search keywords the same replacement
PHP in English mixed character truncation not garbled function (UTF8)
Copy Code code as follows:
Chinese character truncation in UTF8 format
$sourcestr is the string to process
$cutlength the length of the interception (ie the number
PHP default configuration will report this error, my PHP version is 5.2.13, there is this problem:notice:undefined variableThis is to print the warning on the page, although this is good for exposing problems, but there are many problems with
In fact, we can use the Array_filter function to easily remove the multidimensional null value, while the subscript of the array has not changed, the following is an example use:
$array = Array (
0 => ' Tao elder brother ',
1 => false,
2 => 1,
3 =>
I wrote a PHP result set into the JSON format function, you can call directly:
Copy Code code as follows:
function Recordtojson ($recordset)
{
$jstr = ' [';
while ($rs = $recordset->fetch ())
{
$nick = Iconv ("GBK", ' Utf-8
Copy Code code as follows:
Class Bar
{
Public Function test () {
$this->testprivate ();
$this->testpublic ();
}
Public Function Testpublic () {
echo "bar::testpublic\n";
}
Private Function Testprivate () {
echo "bar::testprivate\n";
}
This article describes how to use the Error_log () function in PHP. Share to everyone for your reference. The specific analysis is as follows:
Today encountered a problem needs debugging, but only through the log print debugging, you use the
Sometimes in PHP itself does not meet the requirements of the API, you need to write the appropriate extension, the extension of the completion of the compilation, you can join their own development environment, expand PHP functionality.
This
This article describes the Php+ajax real input automatic search matching method to share for everyone's reference. The specific analysis is as follows:
The first method exploits the jquery autocomplete, the second uses jquery Ajax, and in fact, two
This example describes the way PHP obtains IP addresses and regions via chianz.com. Share to everyone for your reference. The specific analysis is as follows:
The results of an IP acquisition is not perfect, the reason is because ip138 IP
The example in this article describes a workaround where the nvarchar field length is truncated to 255 when PHP connects to MSSQL. Share to everyone for your reference. The specific analysis is as follows:
PHP connected to the novice of MSSQL often
Copy Code code as follows:
Login page settings session, when name is present in session
Session_Start ();
$name = $_session[' name '];
if (empty ($name)) {
Header ("Location:error.php");
Exit ();
//}
Process-oriented, data paging
PHP Multi-process: Using the PHP Process Control functions (pcntl/threading function)
Function Reference visible: http://www.php.net/manual/zh/ref.pcntl.php
Only used in Unix like Os,windows is not available.
When compiling PHP, you need to add
Copy Code code as follows:
Class Crypt3des
{
Private $key = "";
Private $iv = "";
/**
* Constructs, passing two key and IV which have been base64_encode
*
* @param string $key
* @param string $iv
*/
function __construct ($key, $iv)
{
Author Jani Hartikainen published a blog post that compares the two and lists the five reasons why PHP is superior to node.js. Look at it together.
1. Easy to host
Most web hosting providers can provide hosting for PHP, and for node you need to
Two methods and differences of PHP array merging
If it is an associative array, the following:
Copy Code code as follows:
$a = Array (
' WHERE ' => ' uid=1 ',
' Order ' => ' uid ',
);
$b = Array (
' WHERE ' => ' uid=2 ',
'
This example describes how to delete the contents of an XML document through PHP. Share to everyone for your reference. The implementation methods are as follows:
In the first case: delete a student node
Copy Code code as follows:
1,
Sometimes your PHP scripts may require thread-safe guarantees, such as file write operations. This article provides a file lock function and uses examples. The file lock function can also be used to get exclusive processing space to prevent
This article gives an example of how PHP automatically assigns paths when uploading files. Share to everyone for your reference. The specific analysis is as follows:
Site upload files, if it is a small enterprise station, put in a directory is not
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