- 1. PHPvod 视频点播系统 v2.1 for php5.3.x
- 2. phpMyAdmin 3.4.8
- 3. phpMyAdmin 3.4.8 For Linux
- 4. PHP简明教程全集1-23集收藏版
- 5. XAMPP (Apache+MySQL+PHP+PERL) v1.7.2 Final for W
- 6. ASP转PHP工具(小巧简单的ASP转PHP工具) V1.0 绿色...
- 7. phpMyAdmin(支持对数据库进行建立、复制,删除数据等...
- 8. QuickPHP V1.12.1(php脚本调试工具) 绿色免费版
- 9. phpMyAdmin(支持对数据库进行完全操控) V3.4.2.0 F...
- 10. TPerlRegEx最新版(炫音不可少)TPerlRegEx(Delphi...
Perl VS PHP常用代码比较
作者: 来源: 发布时间:2011-12-6 22:41:16 点击:
Perl/Php Translation
arrays hashes data structures array split/join case conversion string comparisons functions | string matching operations basename/dirname environment variables POST/GET parameters HTML elements URL encode MySQL database access |
— Perl arrays — | — Php arrays — |
---|---|
@a = (); | $a = array(); |
— Perl hashes — | — Php hashes — |
---|---|
%h = (); | $h = array(); |
— Perl data structures — | — Php data structures — |
---|---|
%h = ('a'=>13, 'b'=>25); | $h = array('a'=>13, 'b'=>25); |
— Perl array split/join — | — Php array split/join — |
---|---|
@a = split( '|', $s ); | $a = preg_split( '/|/', $s, |
— Perl case conversion — | — Php case conversion — |
---|---|
$s = lc($s); | $s = strtolower($s); |
— Perl string comparisons — | — Php string comparisons — |
---|---|
$s1 eq $s2 | strcmp($s1,$s2) == 0 |
— Perl functions — | — Php functions — |
---|---|
sub foo { | function foo() { |
— Perl string matching operations — | — Php string matching operations — |
---|---|
$s =~ m/(w+)/; | preg_match( "/(w+)/", $s, $match ); |
— Perl basename/dirname — | — Php basename/dirname — |
---|---|
use File::Basename; |
|
— Perl environment variables — | — Php environment variables — |
---|---|
%ENV | $_SERVER |
— Perl POST/GET parameters — | — Php POST/GET parameters — |
---|---|
#form/hyperlink parameters: | #form/hyperlink parameters: |
— Perl HTML elements — | — Php HTML elements — |
---|---|
use CGI (:standard); | # The Perl/CGI functions have the |
— Perl URL encode — | — Php URL encode — |
---|---|
use URI::Escape; |
|
— Perl MySQL database access — | — Php MySQL database access — |
---|---|
use DBI; |
|
上一篇:qq2011 q+增加方法 下一篇:
[收藏此文章]