开发者

I'm using a audio in my web page i need to play it first time but not on page refresh in php

开发者 https://www.devze.com 2022-12-30 22:30 出处:网络
I\'m usinga audio in my we开发者_运维技巧b page i need to play it first time but not on page refreshin php HOW do you play audio?

I'm using a audio in my we开发者_运维技巧b page i need to play it first time but not on page refresh in php


HOW do you play audio?

Apart from that: use a session to save that the page has been loaded and don't play audio on the second load.


<?php
 session_start();
 if(!isset($_SESSION['audioplayed'])){
 // add code to play audio
 $_SESSION['audioplayed'] = true;
 }

?>

you just need to store a boolean in SESSION.

0

精彩评论

暂无评论...
验证码 换一张
取 消