Download the latest smarty:http://smarty.php.net/
Current Latest Version: 2.6.18
After decompression, rename the Libs directory in the directory to smarty, copy to your site directory, and build templates and Templates_c two directories under the
While Ajax supports UTF8
OK, first add a header to the PHP page ("content-type:text/html; Charset=utf-8″);
The code that tells the page this implementation is UTF-8
Then the content to be output with $test = Iconv (' GBK ', ' utf-8′, $test); turn
Such statements, it is obvious that the cause of this is caused by Setcookie, looked at the Internet, like the following explanation: The cookie itself has some restrictions on the use of, for example:
1. The statement of the call Setcookie must be
Copy the Code code as follows:
Establish an index to the new COM component$word = new COM ("Word.Application") or Die ("Can ' t start word!");Displays the version number of the word that is currently in useecho "Loading Word, v. {$word->version}
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.
2. The speed of $row [' ID '] is 7 times times that of $row[id].
3. Echo is faster than print, and
1, there is a forum, the data of the huge post, please briefly explain how to improve the efficiency of users to search posts.
In terms of programs, you can use page caching techniques. In front of the interface design can also allow users to enter
Array_unique (PHP 4 >= 4.0.1, PHP 5)
Array_unique--Removes duplicate values from the divisor group
Description
Array array_unique (array array)
Array_unique () accepts the array as input and returns a new array with no duplicate values.
Note The key
1. Download an integrated environment software, that is, others put all the chaos seven or eight in a piece, made software, this is the SG-style, I think beginners with this good point;
2. Download and install them separately. Php.zend.apache; This
Finally solved the perfect solution dedecms in the [html][/html] and [code][/code] problems, because my PHP is not very skilled, so I have been engaged for several days, to be good, This time mainly modified discuz5.5 and dedecms3.1 function and
The most basic way to page paging:
SELECT ... From ... WHERE ... ORDER by ... LIMIT ...
In the case of small amounts of data, such SQL is sufficient, and the only problem to be aware of is that the index is used:
For example, if the actual SQL is
Support multiple encoding of Chinese string intercept function!
Copy the Code code as follows:
/* * @todo Chinese intercept, support GB2312,GBK,UTF-8,BIG5 * * @param string $str string to intercept * @param int $start intercept start bit *
The code is this:
$link =mysql_connect ("localhost", "root", "123456");
if (! $link) echo "Not connected successfully!";
else echo "connected successfully!";
?>
Where the red part can be modified according to their actual situation.
localhost:
OK, then I have a few questions, not the regular, see how I solve.
1. Clear all the tags in the HTML, leaving only hyperlinks.
I use Strip_tags.
Strip_tags ($data, $tags)
The $data is a string, $tags a reserved label.
Strip_tags ($data, "). Finished?
Give everyone a simple text manipulation of the class
I wrote it before, but I never had a chance to use it, the text is inferior to the database
The data is saved as rows, ending with \ n, note that the data you enter must end with "\ n", which is
Zend Decrypting PHP Zend
Our WwW.DeZend.cc is a professional pair with Zend Encoder/safeguard, Ioncube, Sourceguardian,phpcipher, Codelock or Sourcecop encrypted php file to crack the website, it mainly uses the password analysis, decompression and
When we use query statements, we often have to return the first few or the middle of a few rows of data, this time what to do? Do not worry
MySQL has provided us with such a feature.
SELECT * FROM table LIMIT [offset,] rows | Rows Offset Offset
The
Copy CodeThe code is as follows:
Connecting to a database$db =mysql_connect ("localhost", "root", "");mysql_select_db ("Hy", $db);Set the number of records to display per page$pagesize = 25;Get the total number of records, calculate the total
In practical programming applications we often forget about the function of static. Have a good reflection. :)
We use PHP to query data from the database, and output the results to the browser, if the result has a lot of rows, the table bgcolor if
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