Home > php教程 > php手册 > PHP动态输出JavaScript代码实例

PHP动态输出JavaScript代码实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:10:33
Original
1082 people have browsed it

这篇文章主要介绍了PHP动态输出JS代码实例,本文直接给出代码实例,一看就懂,简洁明了,需要的朋友可以参考下

直接上代码:

$url = $this->getConfig ()->url (); $content = "var url={ base:'{$url->base}',css:'{$url->css}',js:'{$url->js}',img:'{$url->img}',current:window.location};"; $expire = 604800; header ( 'Content-type: application/x-javascript' ); header ( 'Cache-Control: max-age=' . $expire ); header ( 'Accept-Ranges: bytes' ); header ( 'Content-Length: ' . strlen ( $content ) ); echo $content;

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template