📄 snippets.php
字号:
var snippets = new Array();
var i = 0;
<?php
function get_all_parts($string)
{
preg_match_all('#<!--(.*?)-->(.*?)<!--/.*?-->#s',$string,$matches);
$array=array();
for ($i=0;$i<count($matches[1]);$i++)
{
$array[$matches[1][$i]] = $matches[2][$i];
}
return $array;
}
$snippets = file_get_contents('snippets.html');
$matches = get_all_parts($snippets);
foreach ($matches as $name =>$html)
{
print "snippets[i] = new Object();\n";
print "snippets[i]['id'] = '$name';\n";
print "snippets[i]['HTML'] = '".str_replace("\n",'\n',addcslashes($html,"'"))."';\n";
print "i++;\n";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -