This article mainly introduces common PHP functions and summarizes examples and usage of functions such as encryption and decryption, string operations, file operations, and SQL injection, PHP project development is very useful. if you need it, you
Php file download class. Copy the code as follows :? Example: $ downloadnewdownload (php, exe, html, false); if (! $ Download-downloadfile ($ f
The code is as follows:
// ================================================ ====================//
The following describes two implementation methods for saving and downloading php files to a local device. if you need them, refer to the first method:
The code is as follows:
Function downfile ()
{
$ Filename = realpath ("resume.html"); // file
Single-table backupCode:
Copy CodeThe code is as follows:
Class Db
{
var $conn;
function Db ($host = "localhost", $user = "root", $pass = "root", $db = "Test")
{
if (! $this->conn=mysql_connect ($host, $user, $pass))
Die ("can ' t connect to
The first type:
Copy CodeThe code is as follows:
function Downfile ()
{
$filename =realpath ("resume.html"); Filename
$date =date ("ymd-h:i:m");
Header ("Content-type:application/octet-stream");
Header ("Accept-ranges:bytes");
Header
If we use only download or JS window.location = ' file path/filename ' and the file type is browser-aware, then the browser will open the file directly instead of the popup download box to download the file, such as '. txt ', '. conf ', '. bin '
If we only use & lt; ahref & amp; #39; file path/file name & amp; #39; & gt; download & lt;/a & gt; or js window. location & amp; #39; file path/file name & amp; #39; and the file type is recognizable by the browser, the browser will open the file
How PHP generates an RSS feed
The example in this article describes how PHP generates RSS feeds. Share to everyone for your reference. The specific analysis is as follows:
RSS (Simple information aggregation, also known as aggregated content) is a
"Turn" Super practical PHP Function Summary, practical PHP function Summary
Original link: http://www.codeceo.com/article/php-function.html
1, PHP encryption and decryption
PHP encryption and decryption functions can be used to encrypt some useful
This article mainly introduces how to download php files that hide the actual address. It involves the use of the header and file_get_contents methods in php. It is very useful. For more information, see
This article mainly introduces how to
Today's project requirements export Excel. I exported it with the simplest header, but the demand department returned, saying that it didn't meet their needs and that I needed to follow their template to export.Then think of Phpexcel, no use, go a
First, share the header settings when the file is forced to download in CI.[php "View plain Copy if (Strpos ($_server[' http_user_agent ']," MSIE ")!== FALSE) {Header (' Content-type: '. $mime. '); Header (' content-
Php converts HTML pages to word and saves them.
This example describes how php converts HTML pages to word and saves them. We will share this with you for your reference. The details are as follows:
A PHP tool called PHPWord is used here.
The
[Switch] Summary of super practical PHP functions and summary of practical php FunctionsOriginal article: http://www.codeceo.com/article/php-function.html1?php encryption and decryption
The PHP encryption and decryption function can be used to
Summary and collation of super-practical PHP functions2014-12-06 Category: Web development, programming development, home essence of the No comment Source: Moonlight Light Blogshare to: more 81, PHP encryption and decryptionPHP encryption and
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