simplicity is the kingly way ....
function Gentree ($items, $id = ' id ', $pid = ' pid ', $son = ' children ') {
$tree = Array (); Formatted tree
$tmpMap = Array (); Temporary flat data
foreach ($items as $item) {
Play a game when you are bored.Traversing an object is simply a matter of iterating through the properties of a particular array type in the object.PHP5 can be directly foreach, but private members of the class cannot access it.The object-oriented
After improvement no longer traversed by the length of the array before processing, directly according to the length of the processed array
function unique ($ Array)
{
sort ($array);
$arraylength =count ($array);
In the excel.php file
$objActSheet = $objPHPExcel->getactivesheet ();
Set column name
$objActSheet->setcellvalue ("B1", "card number");
Set the width of a column
$objActSheet->getcolumndimension (' B ')->setwidth (20);//
PHP class to manipulate MySQL database
Database Connection Class////////////////////
Class connect{
private $host;//Host Name
private $name;//user name
private $pass;//password
private $conn;//Connection
1, this example uses the Xweibo, the framework detailed technical explanation see:Http://x.weibo.com/download.html 2, use this example, only need to do:If no memcache is used, modify the configuration file user_config.php 53 lines Define ('
An HTTP 500 error occurred while using CodeIgniter, and the view log found the following error: Codeigniter_2.0.2/.htaccess:invalid command ' Rewriteengine ', perhaps Misspelled or defined by a module not included in the server configurationAn HTTP 5
!--? php
echo __file__; Get the absolute address of the current file, result: F:\www\test.php
echo dirname (__file__);//Get the absolute directory where the current file is located, Result: F:\www\
Echo Dirna
First time share, let everybody step on
@charset "Utf-8";
*{padding:0;margin:0;}
. page {
font-size:14px;
Text-align:center
}
. Page Ul{list-style-type:none;display:table;margin-left:auto;margin-right:auto}
PHP's require () and include () are not very different in terms of performance. The only difference is that the file is read and evaluated every time the include () executes, and require () executes the file only once (in fact, the file contents
Require ' command/config.php ';
Require ' command/app.php ';
App::run ($config);
?>
Copy CodeLoad the system configuration file and then load the system configuration through the engine.Second, the engine
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