Thursday 28 February 2019

php - Parse error: syntax error, unexpected 'endif' (T_ENDIF)?



I getting error with php endif, couldn't find the error. here I have given my code. please help me to fix this



       
$video_banner = get_sub_field('video-banner');

?>




Answer



Wrong syntax there :







To be replaced by






writting a ; after the condition of a if is like writting




    if( $video_banner )
{
; //Do nothing
}
?>


This means you have one endif; in excess



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...