Previous development projects did not use a framework, directly object-oriented development of a very useful MySQL tool class.
Header ("Content-type:text/html;charset=utf-8");
Class dbutils{
/**
*
In Python and Golang there is a way to return multiple values at the same time, in fact, PHP can, but compared to Python and Golang a little more trouble, here is a simple demo example, here is a list function
function
Mktime ()
Convert date and time to UNIX timestamp
Time ()
Gets the Unix timestamp for the current time
echo Date ("Y-m-d", Mktime (0,0,0,12,31,2013)). "";
Example: Calculates the age of a user by calculating the
Many times we need to encrypt and decrypt data, such as some data that needs to be saved to a cookie, but not easily accessible by the user, and we need to encrypt the data to be stored in a cookie, and then decrypt it when we need to use it.
Signing, checking, asymmetric, and decrypting with OpenSSL is required to be used with the files of the certificates of the "." (Crt and PEM).
/**
* RSA Algorithm Class
* Signature and Ciphertext code: Base64 string/16
Although Curl is powerful, but can only forge $_server["Http_x_forwarded_for", for most IP address detection procedures, $_server["REMOTE_ADDR"] is difficult to forge: The first is the client.php code.
01
[PHP] Code
Search Links
function Search_link ($moviename)
{
Constructs a URL where max-results can change as needed
$urlString = ' http://api.douban.com/movie/subjects?q= '. $moviename. '
PHP calculates the space occupied by the file under the specified directoryPHP can provide a way to access each element in a subdirectory through the recursivedirectoryiterator extension Directoryiterator's GetChildren () method, and the following
/**
* Verification Code Class
*/
Class base_tool_verify{
/**
* Generate Verification Code method
*/
public static function Createcode () {
Generate a Captcha picture
Full Digital
$str = "D,b,2,3,4,5,6
Class SMTP
{
var $smtp _port;
var $time _out;
var $host _name;
var $log _file;
var $relay _host;
var $debug;
var $auth;
var $user;
var $pass;
var $sock;
function smtp ($relay _host = "",
PHP 5, need to open socket extension
Socke Operation class
Class Socket {
private $host;//host connecting the socket
Private $port;//socket's port number
Private $error =array ();
Private $socket =null;//socket
PHP implements Linux command tail-fToday, I suddenly think of someone asked me a question, how to implement the Linux command tail-f through PHP, here to analyze the implementation. This thought is also quite simple, through a loop detection file,
method One, $_post $_post or $_request is stored in PHP in the form of key=>value format after the data. method Two, using file_get_contents ("Php://input") For post data that does not specify Content-type, you can use File_get_contents
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