The code from Qdig Gallery is:
$excl_imgs[] = end($logo_arrray = explode('/', $header['css_logo_url']));
$excl_imgs[] = end($bg_img_array = explode('/', $header['css_bg_img_url']));
which gives the above error (Strict Standards).
How do I fix this?
Do this instead and your error should go away:
$logo_arrray = explode('/', $header['css_logo_url']);
$bg_img_array = explode('/', $header['css_bg_img_url']);
$excl_imgs[] = end($logo_arrray);
$excl_imgs[] = end($bg_img_array);
You should always try and fix any Strict Standards warning and not just hide them.
You can disable this error and it should be ok. Here's a guide https://www.flexicontent.org/site-content/70-developer-api-field-plugins/285-disabling-php-strict-standards-warning-on-development-servers.html Hope it helps.
I liked to do this to have my code in one line, you can write this method and use end_legacy
instead of end when want to use end like that.
function end_legacy($arr){
if (empty($arr))return false;
if ( PHP_VERSION_ID > 50400) {
$count = count($arr);
$arr = array_values($arr);
return $arr[ $count-1 ];
}
return end($arr);
}