I'm getting this error:
Parse error: syntax error, unexpected T_FUNCTION
at this code:
<?php
$uniqueFtypes = $ftypes = $converter->GetConvertedFileTypes();
array_walk(
$uniqueFtypes,
function(&$ftype, $key) {
$ftype = $ftype['fileExt'];
}
);
$uniqueFtypes = array_values(array_unique($uniqueFtypes));
foreach ($uniqueFtypes as $key => $uftype)
{
echo $uftype;
echo ($uftype != end($uniqueFtypes)) ? (($key != count($uniqueFtypes)-2) ? ', ' : ', or ') : '';
}
?>
At this line:
array_walk(
$uniqueFtypes,
function(&$ftype, $key) {
$ftype = $ftype['fileExt'];
}
);
PHP Version: 5.2.17
It works on localhost, I'm using latest UniServer. But when I moved this to my host, it gives that error.
Any help? :)
Edit: Here is others im not sure does it need fixing.
ini_set('max_execution_time',0);
ini_set('display_errors',0);
// Instantiate converter class
include 'VideoConverter.class.php';
$converter = new VideoConverter();
// On download of converted file
if (isset($_GET['output']))
{
$converter->DownloadConvertedFile($_GET['output']);
}
Second
$vidHosts = array_values($converter->GetVideoHosts());
foreach ($vidHosts as $key => $host)
{
echo $host['name'];
echo ($host != end($vidHosts)) ? (($key == count($vidHosts)-2) ? ((count($vidHosts) > 2) ? ', and ' : ' and ') : ', ') : '';
}
Is there something that needs fixing on these 2 also?