Home > Backend Development > PHP Tutorial > memcache问题

memcache问题

WBOY
Release: 2016-06-23 13:35:45
Original
946 people have browsed it

A页面 new了 然后set          B页面要获取 又要重新new 然后get  有什么办法B页面获取的时候不用new就能获得Anew出来的对象


回复讨论(解决方案)

对象设为全局怎么样

你调用对象当然要new。

a页面有个 $a,b页面要怎么使用呢?

a页面有个 $a,b页面要怎么使用呢?

我就是要建立memcache全局对象哈  这样每次打开页面每次都要new了 减少开销了  我用$GLOBALS没用哈 听说可以用单例?
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template