Wednesday, 28 February 2018

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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...