Technical Notes

Centos, Ubuntu, Windows, Luinx system use
Codec Conversion of String Character Sets-Small Seven Notes

Codec conversion of string character sets

String codec conversion including: utf8 to gbk, Simplified Chinese to Traditional Chinese, unicode to utf8, Ascii to Pinyin, Unicode decoding, etc.
PHP operation directory or file common methods-Small seven notes

PHP common methods to manipulate directories or files

1, convert \ to / /** * Convert \ to / * * * @param string $path path * @return string path */ function dir_path($path) { $path = str_replace('\\', '/', $path); if(substr($path, -1) ! = '/'...
php session and cookie-Small Seven Notes

php session vs cookie

1, set session /** * set session * @param String $name session name * @param Mixed $data session data * @param Int $expire timeout(sec) */ function set _session($name, $data, $expir...
2 years ago
027015
PHP CURL manipulation - Seven Notes

PHP CURL operations

The CURL class implements a wrapper around the PHP Curl extension, using instances of this class to enable remote access. To use this module you need to enable the Curl extension. 1, initiate get request function get_url($url) { $ch = curl_init(); $header[] = ''; curl_setop...
2 years ago
024615
PHP Date, Time, Byte Conversions - Xiao Qi Notes

PHP Date, Time, Byte Conversion

1, convert bytes to other units (Gb, Mb, etc.) 2, time conversion (convert seconds to time) /** * Function dataformat * Time conversion (convert seconds to time) * @param $n INT time */ function dataformat($n) { $hours = f ...
PHP common string processing methods-Small seven notes

PHP common string processing methods

1, realize the search engine to search results hit the keyword marked red <?php /** * Split the string into an array * @param $search search keyword * @return array */ function splitString(string $search):array { // positive ...
2 years ago
01916
PHP DateTime common methods-Small seven notes

PHP DateTime common methods

Instantiation of an object preceded by \ means that the native class is used in the namespace, if the namespace is not used, you can remove the preceding \ 1. Output the current time $datetime = new \DateTime; print_r($datetime->format('Y-m-d H:i...
PHP Objects, Arrays, Strings, Escaping, etc.-Small Seven Notes

PHP objects, arrays, strings, escaping, etc.

1、Convert array to object /** * Convert array to object * @param array $data array * @return Return object (object) */ function array2object($array) { if (is_array($array)) { $obj = new StdClass(); ...
PHP string encryption, decryption functions - Xiaoqi Notes

PHP string encryption and decryption functions

1, simple string encryption, decryption function /** * String encryption, decryption function * * * @param string $txt String * @param string $operation ENCODE for encryption, DECODE for decryption, optional parameter, default is ENCODE, * @param st...
PHP Simple Generation of Random Numbers, Strings - Xiaoqi Notes

PHP Simple Generation of Random Numbers, Strings

1. Generate random string /** * Generate random string * * @param int $length Output length * @param string $chars Optional , default is 0123456789 * @return string string */ function random( $length, $chars ...
PHP to get ip, browser, operating system information-Small seven notes

PHP to get ip, browser, OS information

Get ip, OS, browser information
php on html page compression function-Small seven notes

php to html page compression function

Compression of html pages to reduce file size
2 years ago
028513