웹프로그래밍

Global It Leader!!


PHP


 
 

parse_url, parse_str 함수

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 1건 조회 4,601회 작성일 12-03-10 12:34

본문

 

array parse_url(string url, int component)


* 전달받은 url을 각 부분별로 파싱하여 연관배열에 저장한 후 반환한다.

*

<?php
$url = "http://jcafe.puh.co.kr:8080/php/index.html?id=jcafe";
$info=parse_url($url);
foreach($info as $componentName=>$value) {
    echo "[".$componentName ."] : ".$value. "<br>";
}
?>


출력...

[scheme] : http

[host] : jcafe.puh.co.kr

[port] : 8080

[path] : /php/index.html

[query] : id=jcafe

댓글목록

오원장님의 댓글

no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

<?php
$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str);
echo $first;  // value
echo $arr[0]; // foo bar
echo $arr[1]; // baz

parse_str($str, $output);
echo $output['first'];  // value
echo $output['arr'][0]; // foo bar
echo $output['arr'][1]; // baz

?>

전체 80
게시물 검색
PHP 목록
번호 제목 글쓴이 조회 날짜
40 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4290 08-19
39 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3769 01-23
38 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3952 01-21
37 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3876 01-18
36 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4047 01-18
35 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3667 08-28
34 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3800 04-11
33 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4496 09-19
32 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4730 09-14
31 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4135 08-17
30 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5349 06-08
29 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6300 04-22
28 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4998 04-22
27 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4432 04-22
26 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4388 04-22
25 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4753 04-22
24 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6394 04-20
23 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4188 04-07
22 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5515 03-21
21 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4180 03-21