常年作web的,工做須要,可能有的時候須要將asp代碼批量轉換成php,最近發現一個小東西很不錯,雖不能100%轉換(畢竟是程序),可是大大提升了工做效率php
Asp2Php是一個能夠將ASP轉化成PHP的小程序,作web的可能有時會用到。html
官方下載地址http://asp2php.naken.cc/download.phpmysql
Asp2Php使用方法:web
單個轉換:asp2php 文件名 sql
如文件名是 amznz.asp 那麼在CMD命令下輸入小程序
asp2php amznz.aspwindows
目錄轉換:asp2php -dir 目錄名 -o boracle
如目錄名爲 amznz 那麼在CMD命令下輸入 參數 b 爲存放轉換後的php文件的目錄名post
asp2php -dir amznz -o bui
如下是詳細參數
Usage: asp2php <-options> <infile.asp>
-o <output filename>
-dir (input and output files are directories so copy recursively)
-mysql -odbc -oracle -sybase -postgres (to select database)
-uid <database username>
-passwd <database password>
-database <database name or sid>
-address <database ip address or ip name>
-dsn <database ODBC dsn>
-pngs (for converting links to gifs into png)
-y2k (if your asp came from non-y2k compliant NT Box)
-php3 or -php4 (change extension to .php3 or php4 instead of .php)
-toupper (change all variables to uppercase)
-tolower (change all variables to lowercase)
-html (change links to .htm files to .html)
-includes (change #includes to php requires())
-addextension .xxx (filenames with .xxx extension get asp2php translated)
-spacer (Space out php code differently)
-gif2png (use gif2png instead of ImageMagick [-pngs mode only])
-nomagick (don't convert gif files to png [-pngs mode only])
-global_asa (include global.php in all pages)
-fixwinpaths (fix windows paths [ '\' becomes '/' ])
-longexternvars (use, for example, $HTTP_POST_VARS instead of $_POST)
-fulltags (asp2php will use <?php instead of <?)
-change_response_links (in response.write text as .asp will change to .php)
關鍵詞:asp轉php asp批量轉php