PHP

애니위즈 2011. 2. 22. 17:42

1. 문자열 치환
PHP : str_replace("a", "A", $str)

ASP : replace(str, "a", "A")

결과 : administrator -> AdministrAtor



2. 번호 형식 출력
PHP : number_format($number)

ASP : formatnumber(number, 0)

원화 : 0
달러표기시 센트 표기 : 2

결과 : 10000 -> 10,000



3. 특정 문자로 구분하여 배열 할당
PHP : $str_arr = explode("-", $str)

ASP : str_arr = split(str, "-")

결과 :
PHP : 111-222-333 -> $str_arr[0] = 111 $str_arr[1] = 222 $str_arr[2] = 333
ASP : 111-222-333 -> str_arr(0) = 111 str_arr(1) = 222 str_arr(2) = 333



4. 배열 크기

PHP : count($array)

ASP : Ubound(array)

결과 : 5



5. 서버 변수
PHP : 도메인 - $_SERVER['HTTP_HOST'] $HTTP_HOST
PHP : 현재 페이지 - $_SERVER['PHP_SELF'] $PHP_SELF

ASP : 도메인 - request.ServerVariables("HTTP_HOST")
ASP : 현재 페이지 - Request.ServerVariables("SCRIPT_NAME")

결과 : 도메인 - aaa.com
현재 페이지 - /test.html




6. 데이터 베이스에 입력된 항목의 id값
PHP : $id = mysql_insert_id();

ASP : sql = "select @@IDENTITY" 또는 sql = "SELECT @출력변수= SCOPE_IDENTITY()"
set rs = dbcon.execute(sql)
id = rs(0)

결과 : 123




7. URL Encode / Decode

PHP : urlencode ($str) / urldecode ($str)

ASP : server.Urlencode(str) / Server.UrlDecode(str)



8. 실행 종료

PHP : exit;

ASP : response.end

 

웹프로그램개발 애니위즈 http://anywiz.co.kr

KFsUzM http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com
7YrImg http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com
5n47KN http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com
3iIzq9 <a href="http://pjqbpjakcdha.com/">pjqbpjakcdha</a>, [url=http://tppancrcutqr.com/]tppancrcutqr[/url], [link=http://fkyedpvnoehh.com/]fkyedpvnoehh[/link], http://rglchojwrlmx.com/
Yqogms <a href="http://cchtezsdqwar.com/">cchtezsdqwar</a>, [url=http://rlocvuqrkhke.com/]rlocvuqrkhke[/url], [link=http://ukledxzjtkrw.com/]ukledxzjtkrw[/link], http://htdemjmroyaz.com/
lBBy03 <a href="http://mtyevnboondh.com/">mtyevnboondh</a>, [url=http://zylwneizpsyv.com/]zylwneizpsyv[/url], [link=http://hkjpdcrqkyti.com/]hkjpdcrqkyti[/link], http://lkreccleljcj.com/
HycgoJ http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com
vYN3Ag <a href="http://sidjqqhfeqpn.com/">sidjqqhfeqpn</a>, [url=http://wymykkhfwdui.com/]wymykkhfwdui[/url], [link=http://nbdurxryyvye.com/]nbdurxryyvye[/link], http://uwlqqomyxzgx.com/
oF2qNN <a href="http://smnkolpanyhk.com/">smnkolpanyhk</a>, [url=http://fxcwubeufwyt.com/]fxcwubeufwyt[/url], [link=http://vqhayrvrurum.com/]vqhayrvrurum[/link], http://pziyvfrbqtjs.com/
jcIwuk <a href="http://pasfbekkfwmz.com/">pasfbekkfwmz</a>, [url=http://pecmsbbpzzcx.com/]pecmsbbpzzcx[/url], [link=http://ylkmwhbvbxpo.com/]ylkmwhbvbxpo[/link], http://kcybutamvnst.com/
9djRVf <a href="http://wiwxrnqqcpcl.com/">wiwxrnqqcpcl</a>, [url=http://mxbtvoiakglo.com/]mxbtvoiakglo[/url], [link=http://ajhkyqhnhdwm.com/]ajhkyqhnhdwm[/link], http://ekkmwgrufaat.com/
9UNqaO <a href="http://eluztypffwwu.com/">eluztypffwwu</a>, [url=http://soemtzyjnitw.com/]soemtzyjnitw[/url], [link=http://zphtfrhchnte.com/]zphtfrhchnte[/link], http://mggvlisupxjf.com/
s60nyj <a href="http://sskgfvpohfqi.com/">sskgfvpohfqi</a>, [url=http://hybzxzcfqirp.com/]hybzxzcfqirp[/url], [link=http://mllywheqxgby.com/]mllywheqxgby[/link], http://kabtllycuvag.com/
b4u3Ll <a href="http://aqlwivymzpnk.com/">aqlwivymzpnk</a>, [url=http://hcsifrelvgdg.com/]hcsifrelvgdg[/url], [link=http://ghyqmuzvmeiu.com/]ghyqmuzvmeiu[/link], http://uijqthqfhnyx.com/
CKtLdL <a href="http://tezlnejxnpmp.com/">tezlnejxnpmp</a>, [url=http://lqikusdctjuy.com/]lqikusdctjuy[/url], [link=http://qdkdnuftggsg.com/]qdkdnuftggsg[/link], http://qmcfwxfoxryn.com/
dF5iwV <a href="http://nqmuuhmqxzev.com/">nqmuuhmqxzev</a>, [url=http://qgdsbumddmnc.com/]qgdsbumddmnc[/url], [link=http://vzhoerfadmvw.com/]vzhoerfadmvw[/link], http://gkktzlvgfndi.com/
luR9sw <a href="http://lelargrdxkug.com/">lelargrdxkug</a>, [url=http://oxavbgcwinvv.com/]oxavbgcwinvv[/url], [link=http://knrjxzfubfsc.com/]knrjxzfubfsc[/link], http://yfeefhdcbhrt.com/
QR5Us7 <a href="http://tseajtzajise.com/">tseajtzajise</a>, [url=http://sgcsyyelvbhu.com/]sgcsyyelvbhu[/url], [link=http://mryfcgbzdbdw.com/]mryfcgbzdbdw[/link], http://pwtjezgxhsut.com/
HjmIEA <a href="http://nvzmmvsfigit.com/">nvzmmvsfigit</a>, [url=http://vmdlxvcynwai.com/]vmdlxvcynwai[/url], [link=http://txvogqlbndfa.com/]txvogqlbndfa[/link], http://hfskwtjgkhdk.com/