Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you return the charset of the target url? #62

Closed
shadu120 opened this issue May 28, 2014 · 3 comments
Closed

Can you return the charset of the target url? #62

shadu120 opened this issue May 28, 2014 · 3 comments

Comments

@shadu120
Copy link

I want to know the charset of a target url. but there is no charset in the response html HEAD. How can I know the charset,? do you have any good idea?

@zachborboa
Copy link
Member

Look in $curl->response_headers.

@shadu120
Copy link
Author

most of the internet sites can reply the char-set in Headers. but some cannot.

@zachborboa
Copy link
Member

$curl = new Curl();
$curl->get('https://github.com/timeline.json');
echo $curl->response_headers['Content-Type']; // application/json; charset=utf-8

This works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants