Home > Article > Backend Development > PHP????????????????????????, php_PHP tutorial
PHP????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????
1.??????????????????????????????????????????????????????????????????XML????
2.??????????????????????????????????????????????????
3.??????????????????????????
????????????????????????????????????
1.??????????????????????????????????????
2.????????????????????????????
????????????????????????????????
1.??????????????
2.??????????????
3.????????????
4.????????????????????
5.????????
????????????????????????????
1.??????????????????
2.????????????
3.????????
4.????????
??????????
<?php /** * PluginManager Class * * ???????????????????? * * @link http://www.bkjia.com/ */ class PluginManager { /** * ???????????????? * * @access private * @var array */ private $_listeners = array(); /** * ???????? * * @access public * @return void */ public function __construct() { #????$plugin???????????????????????????????????????? #????????????????????$plugin?????????? #$plugin = array( # 'name' => '????????', # 'directory'=>'????????????' #); // $plugins = get_active_plugins();#?????????????????? //???????????????????????????????? $plugins=array(array("directory"=>"demo", "name"=>"DEMO")); if($plugins) { foreach($plugins as $plugin) {//????????????????????????????actions.php???????????????????????? if (@file_exists(STPATH .'plugins/'.$plugin['directory'].'/actions.php')) { include_once(STPATH .'plugins/'.$plugin['directory'].'/actions.php'); $class = $plugin['name'].'_actions'; if (class_exists($class)) { //?????????????? //$this ???????????? new $class($this); } } } } #?????????????????????????? } /** * ?????????????????????????????? * * @param string $hook * @param object $reference * @param string $method */ function register($hook, &$reference, $method) { //???????????????????? $key = get_class($reference).'->'.$method; //????????????????????push???????????? $this->_listeners[$hook][$key] = array(&$reference, $method); #?????????????????????????? } /** * ???????????? * * @param string $hook ?????????? * @param mixed $data ?????????? * @return mixed */ function trigger($hook, $data='') { $result = ''; //???????????????????????????????????? if (isset($this->_listeners[$hook]) && is_array($this->_listeners[$hook]) && count($this->_listeners[$hook]) > 0) { // ???????????? foreach ($this->_listeners[$hook] as $listener) { // ???????????????????????? $class =& $listener[0]; $method = $listener[1]; if(method_exists($class,$method)) { // ?????????????????? $result .= $class->$method($data); } } } #?????????????????????????? return $result; } } define(STPATH, "./"); $pluginManager=new PluginManager(); $pluginManager->trigger("demo");
demo????????:
<?php /** * ????????Hello World?????????????? * * @link http://www.bkjia.com/ */ /** *???????????????????????? * 1. ??????????????????????action * 2. ??????????????????{??????_actions} */ class DEMO_actions { //????????????????pluginManager?????? function __construct(&$pluginManager) { //???????????? //?????????????????????? //????????????pluginManager?????? //???????????????????????? $pluginManager->register('demo', $this, 'say_hello'); } function say_hello() { echo 'Hello World'; } }
php 是一种服务器端的,嵌入html的脚本语言。php区别其他像客户端java的地方是它的代码在服务器端执行.php能做什么?
最低水平,php可以做任何其他cgi程序所能做的事,例如收集表格数据,生成动态页面内容,或者收发cookies.可能最强大,最有意义的特性是php支持大范围的数据库.书写一个支持数据库的web 页面是难以置信的简单.
下面是当前支持的数据库:
adabas d interbase solid
dbase msql sybase
empress mysql velocis
filepro oracle unix dbm
informix postgresql
php通过协议也支持与其他服务的"交谈",像imap, snmp, nntp, pop3, 甚至是 http. 你也可以打开晦涩的 网络接口和其他协议交互.
php的简要历史
1994年秋季, rasmus lerdorf 开始构思 php. 早期的非发行版本被用在他的主页上,以追踪谁在看他的在线简历. 1995年年初第一版本出台,当时php只被认为是个人主页开发工具.它由一个非常单纯的只能理解很少数特殊宏的分析引擎和 一些用在主页后端通用的工具组成.如留言簿,计数器和其他一些东西.这个分析器在1995年年中被重写并被命名为 php/fi 第二版. fi来自 rasmus 写的另外一个包, 用于解释 html 形式的数据.他结合了个人主页工具脚本和形式解析器,并加 上msql支持.这样就产生 php/fi 了. php/fi以令人惊奇的步调成长,人们开始把自己的代码贡献给它.
很难给出它的硬统计表,但可以估计在1996年末,整个世界至少有15,000个网站在用php/fi.到1997年年中,这个 数字已经超过50,000了. 而在此时php的发展也发生了变化.由rasmus自己偏爱的和几个人开发的项目变成一个更有组织的团 体成就.ev suraski和andi gutmans重写了解析器.这个新的解析器成为php版本3的基础.许多有用的代码从php/fi 继承到php3,并且很多是完全重写的.
今天(1999年年中)不管是php/fi或php3与很多商业产品捆绑在一块,例如c2级强度的web服务器和红帽子linux. 根据netcraft提供的数据推断,保守估计全世界应用php的网站已超过150,000个.由此看来,它比在因特网上运行netscape 的旗舰企业服务器的站点还多.
1.php是网页文件.需要有支持php的web服务器,才能通过浏览器打开.如果你实在要打开,用记事本也可以打开,不过里面是些网页代码.你不一定读得懂 .
2.你所下载的只不过是一个指向(或包含)那个手机铃声的网页,你要真正得到那个铃声的地址才能下载它 .
3.应该不是php,是pdf,你把后缀改一下,php文件是网页格式,用文本编辑器打开,但是本站提供的大部分是pdf格式的,安装一个pdf阅读器就能正常打开了.
4.“把扩展名改成 html ,然后用IE打开。”
5.如果安装了dreamwaver,php文件会显示dreamwaver可以打开的样式
不过用不着
到你下载过的贴子里,看你下载的那个东西的扩展名是什么,比如word文档后面就是.doc, pdf文档后面就是.pdf, 压缩文档后面就是.rar或 .zip之类的
然后把扩展名替换.php......余下全文>>
What you downloaded is a link file similar to asp, not your original file!
It needs to be executed on the server side to reach the correct download address, so it is best to click into the webpage to get the correct download address. For example, if the suffix is similar to rar, then use the download address. If it cannot be obtained, there may be a problem with the server. . Unable to access
PHP is a server-side HTML-embedded scripting language. Its most powerful and important feature is its database integration layer, which makes it incredibly simple to create a web page that contains database functionality. In HTML files, PHP scripts (syntax similar to Perl or C language) can be referenced using special PHP tags, so that web page producers do not have to rely entirely on HTML to generate web pages. Since PHP is executed on the server side, the client cannot see the PHP code. PHP can complete any task that a CGI script can complete, but its functionality depends on its compatibility with various databases. In addition to using HTTP for communication, PHP can also use IMAP, SNMP, NNTP, and POP3 protocols.