Home>Article>Backend Development> PHP implements the principle of progress bar

PHP implements the principle of progress bar

王林
王林 forward
2019-09-06 14:48:26 3115browse

PHP implements the principle of progress bar

The principle of PHP implementation of progress bar:

Template replacement, set a logo on the page, wheel your own page, without sending a request to the server , the server side obtains the progress, and then replaces the page identifier to achieve the progress bar effect.

Page code:

               进度条   
0
{%a%}

Server code:

'; echo str_repeat(' ' ,2024); $url = '/t/test.php'; header("Location: " . $url.'&id='.$i); $read_url = realpath('.'.$url); $content = file_get_contents('D:/phpnow/htdocs11/design/t/test.php'); $rr = preg_replace('/{%(.*)%}/','{%'.$i.'%}',$content); file_put_contents('D:/phpnow/htdocs11/design/t/test.php',$rr); ob_flush(); flush(); sleep(1); } ?>

The above is the detailed content of PHP implements the principle of progress bar. For more information, please follow other related articles on the PHP Chinese website!

php
Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete