COUNT (): counts the number of elements in the array;sizeof (): and Count () have the same purpose, both functions can return the number of array elements. You can get the number of elements in a regular scalar variable, if the array passed to the
Php bubble Sort by small to largeIdea: The array from the last number to the penultimate one compares the smallest of the two smallest to the front and then pushes a comparison in this way to the smallest and then cycle$arr =array
Php counts the number of array elements and the number of php Arrays
Count (): counts the number of elements in the array;Sizeof (): it has the same purpose as count (). Both functions can return the number of array elements. we can get the number
Use the basic configuration of Smarty3 in CodeIgniter, codeignitersmarty3
1. Create a Smarty class library
1. Copy the smarty libs file to libraries (here I will rename it as smarty)2. Create a Cismarty. php file. (In accordance with the file
Install PHP and Its modules
We know that ASP requires support from PWS or IIS servers. Without these two servers, it cannot run. ASP servers support the installation of ASP
Interpreter and WEB server.
Similarly, the installation of PHP is divided
PHP study notes 5-class inheritance/method rewriting, study notes 5-
Change the Man. php file name to People. php and add the following code:
1 public function hi () {2 return $ this-> _ name. 'Say Hi'; 3}
Create a file Man. php:
1 getName (). '
PHP multi-state code instance and php multi-state instance
Polymorphism: Only one interface or base class is concerned, but not the specific class of an object. (Same type, different results)
Here are two examples:
First, we found that the base
Cache php variables as files,
This example describes how to cache php variables as files. Share it with you for your reference. The specific implementation method is as follows:
'. /cache/', // cache time 'cachetime' => 20, // cache type 'cachetype'
Php uses the header information to determine the image type,
This example describes how php judges the image type by obtaining the header information. Share it with you for your reference. The specific implementation method is as follows:
$
Is your php webpage garbled?
I,
When writing web pages, when designing Chinese content for storage, most of the problems may be garbled. If the code is garbled, we can check three aspects.
(1) Whether the webpage code is correct, for example,
Php session Database
It is very easy to save sesison to the database. It is used to perform CRUD operations on the Database Based on session_id. session_set_save_handler is used to customize the session execution method,
First create a data table
Common http header settings for php header functions, phpheader Function
// Okheader ('HTTP/1.1 200 OK '); // set a 404 header: header ('HTTP/1.1 404 Not Found '); // set the address to be Permanently redirected header ('HTTP/1.1 301 Moved
Nginx + thinkphp solves the problem that pathinfo mode is not supported and various 404,500 problems exist. nginxpathinfo
After two days of nginx environment problems, I found that many posts on the Internet were either copied and pasted, or they
PHP implements two-way linked list
I have read the data structure for a long time, but I have never used it. I have read the data structure of PHP on the Internet and shared it with you. The last time I shared the linked list, I would like to add a
Books that every PHP developer should read.
PHP has a poor reputation in recent years. There is a lot of discussion about its "bad design summary" and syntax conflicts, but the main complaints are usually security. Many PHP sites are hacked in
How to send an email using Thinphp
I haven't moved php for a long time. I suddenly wanted to use thinkphp to send an email, but I was confused when I checked the books and did not continue reading them. Here I found a better method:
Step 1: first
Php uses the header information to determine the image type
This example describes how php judges the image type by obtaining the header information. Share it with you for your reference. The specific implementation method is as follows:
?
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