質問

I want to remove this background color after 10 seconds using php. I don't want to use js, css. Is it possible to remove background color using pure php code?

<?php $running_location = '<p style="background:#E1FEE0;"></p>' ?>;
役に立ちましたか?

解決

PHP runs on the server. All the work it does is finished before the browser receives the page.

Server side code cannot alter the page on the client after the page has been delivered.

You have to use a client side technology for this. Sensible approaches would be CSS animations or JavaScript. (NB: I'm assuming CSS animations can do this, I haven't used them enough to be sure).

Less sensible options would be to use a refresh either via HTML meta or HTTP to load an entirely new page from the server (which is identical but without the background colour).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top