一、文件的上传
1、客户端设置:
二、文件下载(1)、在
三、文件函数库简单文件下载只需要使用HTML的链接标记,并将属性href的URL值指定下载的文件即可。这种方法只能处理一些浏览器不能识别的MIME类型文件。
为了提高安全性,不希望在a标签中给出文件链接,则必须向浏览器发送必要的头信息,我们可以使用如下代码。
四、序列化与反序列化touch
设置文件的访问和修饰时间
bool touch(string $filename[, int $time[, int $time]])
copy
复制文件
bool copy(string $source, string $dest)
注意:移动文件请使用rename函数
file_put_contents
将一个字符串写入文件
int file_put_contents(string $filename, string $data[, int $flag[, resource $content]])
file_get_contents
将整个文件读到字符串
string file_get_contents(string $filename[, bool user_include_path [, resource $content[, int $offset[, int $maxlen]]]])
serialize
序列化
string serialize(mixed $value)
注意:serialize()可处理除了resouce之外的任何类型。甚至可以serialize()那些包含了指向其自身引用的数组。
unserialize
反序列化
mixed unserialize(string $str)
● date
格式化一个本地时间/日期
string date(string format[, int timestamp]);
● getdate
取得日期/时间信息
array getdate([int timestamp]);
● microtime
返回当前Unix时间戳和微秒数
mixed microtime([bool get_as_float]);
● date_default_timezone_set
设置默认时区
bool date_default_timezone_set(string timezone_identifier);
● date_default_timezone_get
获取默认时区
string date_default_timezone_get(void);
三、字符函数库
strlen
获取字符串长度
int strlen(string $str);
strtolower
字符串转换为小写
string strtolower(string $str);
strtoupper
字符串转换为大写
string strtoupper(string $str);
ucfirst
首字母大写
string ucfirst(string $str);
ucwords
将每个单词的首字母转换为大写字母
string ucwords(string $str);
ltrim
从字符串开始的位置删除空格或其他字符
string ltrim(string $str [, string $charlist]);
rtrim
从字符串结束的位置删除空格或者其他字符
string rtrim(string $str[, string $chirlist]);
trim
从字符串开始和结束的位置删除空格或者其他字符
str_replace
字符替换
mixed str_ireplace(mixed $search, mixed $replace, mixed $subject, [int $count]);
str_ireplace
字符替换
mixed str_ireplace(mixed $search, mixed $replace, mixed $subject, [int $count]);
md5计算字符串的MD5哈希
string md5(string $str[, bool $raw_output=false]);
strpos
返回一个字符在另一个字符第一次出现的位置
int strpos(string haystack, mixed needle[, int offset]);

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
