note 111733 added to function.substr
| From: | ngocub at gmail dot com | Date: | Fri, 22 Mar 2013 01:54:07 +0000 |
| Subject: | note 111733 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194169@lists.php.net to get a copy of this message | ||
If you set different encode in php.ini like UTF-8, the substr function will be not provide same
result. This is the sample code for test it.
$content = file_get_contents('http://a.webutation.net/3/1/news.google.com.vn.jpg');
$result = substr($content,0,3);
print_r($result);
So please notice your encode before put down all your hair by don't know why.
----
Server IP: 69.147.83.199
Probable Submitter: 117.7.69.178
----
Manual Page -- http://php.net/manual/en/function.substr.php
Edit -- https://master.php.net/note/edit/111733
Del: integrated -- https://master.php.net/note/delete/111733/integrated
Del: useless -- https://master.php.net/note/delete/111733/useless
Del: bad code -- https://master.php.net/note/delete/111733/bad+code
Del: spam -- https://master.php.net/note/delete/111733/spam
Del: non-english -- https://master.php.net/note/delete/111733/non-english
Del: in docs -- https://master.php.net/note/delete/111733/in+docs
Del: other reasons-- https://master.php.net/note/delete/111733
Reject -- https://master.php.net/note/reject/111733
Search -- https://master.php.net/manage/user-notes.php