Hi!
I'm trying to get all my first characters in a PHP array to be uppercase.
PHP code:
<?php
$ordlista = file_get_contents('C:/wamp/www/bilder/filmlista.txt');
$ord = explode("\n", $ordlista);
sort($ord,SORT_STRING);
foreach ($ord as $key => $val) {
echo $val."<br/>";
}
?>
Thanks ahead for answers!
Solved:
<?php
$ordlista = file_get_contents('C:/wamp/www/bilder/filmlista.txt');
$ord = explode("\n", $ordlista);
$ord=array_map(function($word) { return ucwords($word); }, $ord);
sort($ord,SORT_STRING);
foreach ($ord as $key => $val) {
echo $val."<br/>";
}
?>