Recently I have asked for help regarding an automated PHP gallery. The script is now finished, but i face one more problem.
Here is the script:
<?php
$directory = "path/of/directory";
foreach (glob($directory . "*.jpg") as $pathinfo) {
echo '<a href="' . $pathinfo . '">
<img src="' . $pathinfo . '" width="500" height="333" title="' . basename($pathinfo, ".jpg") . '"/>
</a>';
}
?>
Since I’m in Croatia, I use special characters ( e.g. č, ć, š, đ, ž ). Html can read the characters fine, but PHP obviously has a problem with that. I’ve tried decoding and encoding, declaring the UTF-8 in the head of PHP, but nothing works. The problem is that it can’t read the directory path if there are special characters, but instead of echo-ing them correctly, i get “?”
Does anyone know how to enable special characters?