webpack4:
// webpack 是node写出来的
let path = require('path');
module.exports = {
mode:'development’, //模式 默认两种 production(生产)/development(开发)
entry:'./src/index.js’, //入口
output:{
filename:'bundle.js’, //打包后的文件名
path:path.resolve(__dirname,'dist’), //路径必须是一个绝对路径
}
}
PHP报错:
unserialize(): Error at offset 0 of 100 bytes
function mb_unserialize($str) {
return preg_replace_callback('#s:(\d+):"(.*?)";#s',
function($match){return 's:'.strlen($match[2]).':"'.$match[2].'";';},$str);
-----------------------------------------------------------------------------
$str = preg_replace_callback('#s:(\d+):"(.*?)";#s',
function($match){return 's:'.strlen($match[2]).':"'.$match[2].'";';},$str);
移动端判断
<script>
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
console.log('移动端要执行的代码');
window.location.href = "http://baidu.com;
}
</script>