用PHP开发桌面应用程序

PHP可以开发桌面程序,不要怀疑这一点,请听我一一道来。

Most of us are familiar with PHP Web Applications. But PHP standalone application is something new. Now we can make standalone applications with PHP GTK. This how you will create your first destkop Application dispalying ‘hello world!’ using PHP GTK.

1) You can get PHP GTK for download from http://gtk.php.net/download.php
Just Download php-gtk-2.0.1 Windows binary pack.

2) Put the extracted folder in “c:\php-gtk2″.

3) Save the following code in hello.php file.

CODE:

<?php
$window = new GtkWindow();
$window->connect_simple(‘destroy’, array(‘Gtk’,'main_quit’));
$label = new GtkLabel(“hello world!”);
$window->add($label);
$window->show_all();
Gtk::main();
?>4)  That’s it now you can execute this code by “c:\php-gtk2\php hello.php”.

005121f9fd4ssk4vfkuuth.jpg
图片1.jpg


5)  You will get an output “hello world!”.

0051227c61adjqqd2zq777.jpg
图片2.jpg


For more tutorials visit http://gtk.php.net/manual/en/tutorials.php For any queries or questions comment or contact us.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/301743/viewspace-732999/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/301743/viewspace-732999/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值