Tag Archives: Php

special characters in “file_exists” problem (php)

If it’s Windows, you’ll not be able to access files under a UTF-8-encoded filename, because the Windows implementation of the C IO libraries used by PHP will only talk in the system default code page. For Western European installs, that’s code page 1252. You can convert a UTF-8 string to cp1252 using iconv:

Generate a sitemap in a codeigniter application

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling..

Truncate a string in php without cutting words

truncate strings when they are longer than 20 chars. Words must always stay together, so that this: