How to add and delete array elements in php
$ Fruits = array ("apple", "banana ");
Array_unshift ($ fruits, "orange", "pear ")
// $ Fruits = array ("orange", "pear", "apple", "banana ");
Add elements at the
Example of using CI to operate multiple databases
Function _ construct ()
{
Parent: :__ construct ();
$ This-> xx = $ this-> load-> database ('XX', TRUE );
$ This-> load->
An example of how to define a php long string (heredocument)
$ Xx =
I am not long,
I am not long,
I am not long ,?
Script school http://bbs.it-home.org
Html;
How to create an array in php
Php does not need to specify its size when creating an array. Since php is a loose language, you do not even need to declare it before using arrays. Although there are no strict restrictions, php still
Common php design modes: Factory mode and Singleton mode
/**
Example of Factory mode
@ Link http://bbs.it-home.org
*/
Abstract class Operation {
Abstract public function getValue ($ num1, $
Usage of fgetcsv and compatibility issues in windows and linux
$ File = fopen ("contacts.csv", "r ");
Print_r (fgetcsv ($ file ));
Fclose ($ file );
?>
CSV file: George, John, Thomas, USA James,
A php code that accurately counts the number of online users
Using filename='online.txt '; // data file
$ Cookiename = 'vgotcn _ onlinecount'; // cookie name
$ Onlinetime = 600; // online validity
The problem of data packet loss transmitted by php big form using the post method
In the production environment, a huge form, including three images, hundreds of input boxes and nearly one thousand checkboxes, is intercepted when The
Php removes html tags to obtain the input plain text document strip_tags
$ Text ='Test paragraph.
Other text ';
Echo strip_tags ($ text );
Echo "\ n ";
// Allow
Echo strip_tags ($
Php sets the index. php file to read-only
Function set_writeable ($ file_name)
{
If (@ chmod ($ file_name, 0555 ))
{
Echo "the read-only attribute of the index. php file has been modified ";
}
Questions about calling php built-in functions in smarty
Function SmartyLen ($ params ){
Extract ($ params );
$ Len = strlen ($ text );
$ Max = $ length;
For ($ I = 0; $ I
$ Chr = substr ($
You do not need to re-compile php to add the ftp extension method.
Extension_dir = "/usr/local/php/etc/ext"
# Load module
Extension = ftp. so
# Save and exitNow, the ftp extension is
So that your PHP object can be foreach, and attributes are modified using Private
If you are bored, you can play with it.The traversal object is actually just a specific attribute of the array type in the object.You can use foreach directly
B2Core: 300-line phpMVC architecture
B2Core is a lightweight php MVC framework. the 300-line code encapsulates common CRUD and other practical functions.For the latest code, see the http://b2core.b24.cn, and welcome criticism and
Use functions to delete and copy files. check whether magic reference is enabled.
The deletion and copying of files through functions has shown whether magic reference is enabled.
/**
I still have a hard time
*
How can I quickly find the element in the middle of a single-chain table with unknown length?
How can I quickly find the element in the middle of a single-chain table with unknown length?
// Only the train of thought
//
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