Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
Fish eating

techmoe dev-techmoe

🐈
Fish eating
View GitHub Profile
@dev-techmoe
dev-techmoe / jq_dom_exist.js
Created Feb 27, 2016
jquery插件,判断指定dom是否存在
View jq_dom_exist.js
/**
* 判断dom是否存在的jq插件
* USEAGE: $(selector).exist() (return true or false)
*/
(function($) {
$.fn.exist = function(){
if($(this).length>=1){
return true;
}
return false;
@dev-techmoe
dev-techmoe / is_serialized.php
Last active Jan 25, 2016
判断指定字符串是否为序列化字符串
View is_serialized.php
<?php
function is_serialized( $data ) {
$data = trim( $data );
if ( 'N;' == $data )
return true;
if ( !preg_match( '/^([adObis]):/', $data, $badions ) )
return false;
switch ( $badions[1] ) {
case 'a' :
case 'O' :
You can’t perform that action at this time.