"보안상의 이유로"PHP의 콘텐츠 유형을 얻어야합니다. 예를 들어, header("Content-type: text/html; charset=utf-8")
함수를 사용한 경우 향후 실행 시간에 콘텐츠 유형 (text/html
)과 문자 집합 (utf-8
)을 각각받을 수 있습니까?header()에서 PHP 콘텐츠 유형 가져 오기
내 진짜 문제는 사용하고 수정되고있는 캐릭터 세트 알고있다 만이, 정보 Content-type
를 다시 정의 할 필요없이, 필요한 경우. 즉 콘텐츠 유형이 application/xml
인 경우 그대로 유지하지만 은 문자 집합 만 변경하십시오.
Ex.
Original: Content-type: text/html
First: -> set to application/xml.
Content-type: application/xml
Second: -> set charset.
Content-type: application/xml; charset=utf-8
Third: -> set to text/html
Content-type: text/html; charset=utf-8
어떻게 가능합니까?
당신은'Accept' 헤더를 붙잡기를 원하십니까 – DevZer0