Pre-defined constants in PHP:
__file__
The file name of the script currently being processed. If used in a contained file, then its value is the contained file, not the file name that contains it.
__line__
The current number of rows in the file
Class helper_page{
/** total number of messages */
var $infoCount;
/** Total pages */
var $pageCount;
/** show number of bars per page */
var $items;
/** Current Page */
var $pageNo;
/** the starting position of the query */
var $startPos;
/** Next
Copy CodeThe code is as follows:
PHP iterates through all the files in the folder
$handle =opendir (' c:\\ '); I'm going to traverse the C-drive file.
echo "Catalog handle: $handle
";
echo "File:
";
while ($file =readdir ($handle)) {
$file
Class clear_virus{
Public $index = ' b.html ';
Public $filepath =array (' b.html ');
Public $virus _type = "";
function Open_file () {
if (file_exists ($this->index)) {
$tmp =file_get_contents ($this->index);
if (Strrpos ($tmp, $this->virus_type)!==
Encrypt PHP programs with Eaccelerator
Copy CodeThe code is as follows:
#/usr/local/bin/encoder
After execution, you will see simple instructions for use:
Copy CodeThe code is as follows:
Usage:encoder [Options] Source_file_name
Encoder [Options]
Q: How do I create a new file?
A: 1, use fopen ("file name to establish", "parameter"), parameter optional w,w+,a,a+
2. Use EXEC ("echo ' > file name to be established"), so you can use the system to build this file, you may also use Touch this
1. When an error like "File not Found" appears, check that the include file is in the correct location, referring to the following quote from the PHP manual page:
Files for including is first looked in include_path relative to the current working
(1) All data should be hidden inside the class in which it resides.
(2) The consumer of a class must depend on the common interface of the class, but the class cannot rely on its consumer.
(3) Minimize the message in the class's protocol.
(4)
Actually add together there are dozens of, but because the need to manipulate the data more, in the back with a small program to solve. You can handle data that was not processed yesterday, as follows:
Copy CodeThe code is as follows:
$handle =
However, it is not easy to be a master of PHP programming. Not as many people think, as long as you can quickly write a few simple code to solve a complex problem is the PHP programmer, the real PHP master also need to consider more other issues.
On the other hand, sometimes a single line of code can be used to solve a problem.
Here are some cool features that you probably didn't notice:
Use the Ip2long () and LONG2IP () functions to convert an IP address into an integer store into a
The time format is 2008-06-16
Check out the Day data:
SELECT * from ' table ' WHERE date (time field) = Curdate ();
Query out the Month field:
SELECT *
From ' table '
WHERE Month (time field) = Month (now ());
The time format is 1219876 ... Unix
Problem: For example, implement the following
$data = Array (
' id ' = $_post[' id1 '],
' Name ' = ' $_post[' name1 '
);
$posts = $this->_modelstudent->findall ($data);
The text box with ID name on the page can enter the ID query or enter the name
This time in reading "PHP and MySQL Web development" a book to see Str_replace explanation, a little hint to write: can be used in the array of Str_replace three, but the explanation is relatively simple, so decided to experiment with the function
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