Encoding Conversion functions
function Utf8togb ($s) {
Return Iconv (' Utf-8 ', ' gbk//ignore ', $s); The IGNORE parameter is ignored when a character that is not converted is encountered
}
It is recommended to replace all
/*
Author:nick
Function: Generate Selettree
Property:
$result result set
$id _field Self ID field
$parent _field The parent class ID field
$option _text Option Display Name
$select the name of the _name
The legend is Sina PHP engineer pen question
function My_dir ($dir) {
$files =array ();
if (@ $handle =opendir ($dir)) {//note here to add a @, otherwise there will be warning error:)
while (($file =readdir
/*
$array _name: the incoming array;
$row _id: An array of items to sort;
$order _type: Sort by the way, ASC or DESC;
*/
function Array_sort ($array _name, $row _id, $order _type) {
$array _temp=array ();
foreach ($
Ignore_user_abort (); PHP scripts can continue to execute even if the client disconnects (such as turning off the browser).
Set_time_limit (0); Execution time is unlimited, php default execution time is 30 seconds, through Set_time_limit (0)
/*
Function name: checkemailaddr ($C _mailaddr)
Role: Determine whether a valid email address
Parameters: $C _mailaddr (e-mail address to be detected)
Return Value: Boolean value
Remark: None
*/
function
'**************************************************
' Function name: gottopic
' function: truncated string, Chinese characters one count two characters, English count a character
' parameter: str----the original string
' strlen---
Programmer: For the current design, I can fix the basic framework in about a week. We then refine and refine the design from scratch and submit a stable version in the next week. The project manager understands that the whole project can be done in
Programmers have encountered many strange opponents on the way to code, and have encountered strange teammates. I was at least exposed to five different "code fighters". Some of these guys are helpful in the development work, while others seem to
Two-dimensional arrays eliminate duplicate values
function ARRAY_UNIQUE_FB ($array 2D) {
foreach ($array 2D as $v) {
$v = Join (",", $v); Dimension, you can also convert one-dimensional array to a comma-concatenated string using
!--? php
class RunTime {
private $starTime;//start time
private $stopTime;//End
Private Function Getmictime () {
$mictime =microtime ();//get timestamp and number of microseconds
/**
* Calculate program Run time
* filename:js_runtime.php
*/
Class Timer {
Private $StartTime = 0;//program run start time
Private $StopTime = 0;//program Run end time
Private $TimeSpent = 0;//program takes time
!--? php
$pic = ' abc.3434.342.12123.123.exe ';
$pics = Explode ('. ', $pic);
/* Get the total number of arrays and take the last */
echo $num = count ($pics);
echo ' '. $pics
# vim/etc/php.inidisplay_errors = Off
Log_errors = On
Error_log =/var/log/php-error.log
Copy CodeAlternatively, you can set error_log = syslog to log these error messages to the operating system. display_errors =
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