我在PHP中有一个文本字符串:
<strong> MOST </strong> of you may have a habit of wearing socks while sleeping.
<strong> Wear socks while sleeping to prevent cracking feet</strong>
<strong> Socks helps to relieve sweaty feet</strong>
Run Code Online (Sandbox Code Playgroud)
我们可以看到,第一个强大的标签是
<strong> MOST </strong>
Run Code Online (Sandbox Code Playgroud)
我想删除第一个强标记,并在其中使用ucwords(首字母大写).结果是这样的
Most of you may have a habit of wearing socks while sleeping.
<strong> Wear socks while sleeping to prevent cracking feet</strong>
<strong> Socks helps to relieve sweaty feet</strong>
Run Code Online (Sandbox Code Playgroud)
我尝试过使用爆炸功能,但它似乎不像我想要的那样.这是我的代码
<?php
$text = "<strong>MOST</strong> of you may have a habit of wearing socks while sleeping. …Run Code Online (Sandbox Code Playgroud) 有没有办法从youtube链接获取视频ID.
我有一个PHP脚本的方式,但我需要在JavaScript中.
这是我的PHP脚本
function get_youtube($url){
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
return $my_array_of_vars['v'];
}
Run Code Online (Sandbox Code Playgroud)
例如,我有一个youtube视频链接
http://www.youtube.com/watch?v=fWNaR-rxAic&list=RD029I9Ar6upx34
然后我得到V variable = fWNaR-rxAic的内容