JS时间戳转换时间,时间转时间戳源码时间转时间戳源码:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>时间戳格式化</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;} </style></...
JS最简单的BASE64编码解码JS-BASE64编码解码函数源码:<p id="demo"></p> <script> function base64(str,code) { if(code==0){return window.btoa(unescape(encodeURIComponent(str)));}else if(code==1){return decodeURIComponent(escape(window.atob(str)));} } document.getElementById("demo"...
网页禁止右键和F12打开控制台禁止右键: document.oncontextmenu = new Function("return false;"); 禁止F12: document.onkeydown = document.onkeyup = document.onkeypress = function(event) { var e = event || window.event || arguments.callee.caller.arguments[0]; if (e && e.keyCode == 123) { ...
JS验证码60秒倒计时源码<input id="btn" onclick="settime(this)" type="button" value="获取验证码" style="width: 6.125rem;height: 1.875rem;margin-top: -10.25rem;float: right;" /> <script type="text/javascript"> //验证码倒计时 var countdown=60; func...
PHP压缩字符串/** * 判断字符串是否base64编码 */ function func_is_base64($str) { return $str == base64_encode(base64_decode($str)) ? true : false; } /** * 压缩内容 */ function func_gzcompress($str, $level = 9) { if (!func_is_base64($str)) { return base64_encode(gzcompress($str, $level)); ...
<!DOCTYPE html> <html lang="en"> <head> <title>JS代码AES加解密实例</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.bootcdn.net/ajax/libs/...
PHP将中英文分割成数组function mb_str_split($str){ return preg_split('/(?<!^)(?!$)/u', $str ); } $str='日韩赶SEO博客Hello World!'; print_r(mb_str_split($str));
PHP文本倒序输出中英文function mb_str_split($str){ return preg_split('/(?<!^)(?!$)/u', $str ); } $str='日韩赶SEO博客Hello World!'; print_r(implode(array_reverse(mb_str_split($str))));
JS倒序输出文本<script language="javascript"> var str = "www.180it.com技术博客"; document.write(str.split("").reverse().join("")); </script>