如何使用PHP进入嵌套大括号?
例:
{{ text1 {{text2 text3 {{text4}} text5}} }}
Run Code Online (Sandbox Code Playgroud)
应该输出
1- text1 {{text2 text3 {{text4}} text5}}
2- text2 text3 {{text4}} text5
3- text4
Run Code Online (Sandbox Code Playgroud) 我有多行文字,并且只想匹配没有数字的行:
text without numbers
text 1 with number
some other text
text without numbers
text 1 with number
text without numbers
text 1 with number
Run Code Online (Sandbox Code Playgroud)
我运气不好.任何建议表示赞赏.
我<UL>
里面有2个或更多套,并且只想将第一个UL <a>
设置为粗体.实际上,这是一个包含多个子菜单的菜单,我只想让父链接变粗.
我知道可以通过添加更多ID或类来完成,但这不是一个选项,只想尝试css方法.
<ul class="menu">
<li class="collapsed first">
<a title="Mechanical products" href="1">Mechanical Products</a>
</li>
<li class="collapsed">
<a title="Chemicals" href="2">Chemicals</a>
</li>
<li class="expanded active-trail">
<a title="Instrumentation" href="3">Instrumentation</a>
<ul class="menu">
<li class="leaf first">
<a title="Control valves FISHER" href="4">Control Valves</a>
</li>
<li class="expanded active-trail">
<a class="active" title="Corrosion Monitoring System" href="5">Corrosion Monitoring</a>
<ul class="menu">
<li class="leaf first">
<a title="Access Fitting Assemblies" href="6">Fitting Assemblies</a>
</li>
<li class="leaf last">
<a title="Coupon Holders, Coupons & Probes" href="7">Holders,Coupons</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="collapsed"> …
Run Code Online (Sandbox Code Playgroud) 可能重复:
PHP8中的CRC8-Check
有没有好的PHP 8bit CRC生成?我搜索过,找不到任何好的消息来源.我发现了16位:
function crc16($string) {
$crc = 0xFFFF;
for ($x = 0; $x < strlen ($string); $x++) {
$crc = $crc ^ ord($string[$x]);
for ($y = 0; $y < 8; $y++) {
if (($crc & 0x0001) == 0x0001) {
$crc = (($crc >> 1) ^ 0xA001);
} else { $crc = $crc >> 1; }
}
}
return $crc;
}
Run Code Online (Sandbox Code Playgroud)