我怎么用正则表达式?

时间:2016-06-02 14:06:33

标签: php regex

我如何使用正则表达式?

about in what situations i can use it ?

1 个答案:

答案 0 :(得分:2)

<?php
    preg_match("/(wmsAuthSign\=[^\&]+)/", $your_string, $matches);
?>

<script data-cfasync='false' type='text/javascript'>
    jwplayer('playerjxJRqLMFuJaA').setup({
        file: 'http://127.0.0.1:8081/live/ssport/playlist.m3u8?<?php echo $matches[1]; ?>',
        aboutlink: '',
        controls: 'true',
        title: 'Live Stream',
        width: '890',
        height: '640',
        stretching: 'exactfit',
        autostart: 'true',
        primary: 'flash',
        skin: 'bekle',
        androidhls: 'true'
    });
</script>