This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See http://www.php.net/manual/en/class.domelement.php#101243 | |
function get_inner_html( $node ) { | |
$innerHTML= ''; | |
$children = $node->childNodes; | |
foreach ($children as $child) { | |
$innerHTML .= $child->ownerDocument->saveXML( $child ); | |
} | |
return $innerHTML; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists('sub_str')) { | |
/** | |
* 截取UTF-8编码下字符串的函数 | |
* | |
* @param string $str 被截取的字符串 | |
* @param int $length 截取的长度 | |
* @param bool $append 是否附加省略号 | |
* | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function clean_dir($dir, $self = false) { | |
//先删除目录下的文件: | |
$dh = opendir($dir); | |
while ($file = readdir($dh)) { | |
if($file != '.' && $file !== '..') { | |
$full_path = $dir .'/'. $file; | |
if(! is_dir($full_path)) { | |
unlink($full_path); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// Sublime Text - Build System for Javascript | |
{ | |
"cmd": ["node", "$file"], | |
"selector": "source.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Delete($path) | |
{ | |
if (is_dir($path) === true) | |
{ | |
$files = array_diff(scandir($path), array('.', '..')); | |
foreach ($files as $file) | |
{ | |
Delete(realpath($path) . '/' . $file); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update forumdata_userttt set userLink=concat('http://weibo.com/',userLink) where id>198; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: yeho <lj2007331 AT gmail.com> | |
# BLOG: https://blog.linuxeye.com | |
# | |
# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ | |
# | |
# Project home page: | |
# https://oneinstack.com | |
# https://github.com/lj2007331/oneinstack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = [1, 3, 4, 6, 5, 7, 2, 8, 9]; | |
# 快速排序 | |
function quickSort($arr) { | |
$len = count($arr); | |
if ($len < 2) { | |
return $arr; |