Parse error: syntax error, unexpected T_CONSTANT
Posted: Tue Nov 29, 2011 2:42 pm
Hi,
I have an array below. The individual part of the code below (starting with 'javascriptcode') is triggering a php error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
I understand the error is because " or ' are not escaped properly. I was able to remove the error from the other lines of code. For some reason, I cannot get this error for the bolded line of code to go away though.
I have an array below. The individual part of the code below (starting with 'javascriptcode') is triggering a php error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
I understand the error is because " or ' are not escaped properly. I was able to remove the error from the other lines of code. For some reason, I cannot get this error for the bolded line of code to go away though.
Code: Select all
'javascriptcode' => 'setpage(\'thumb' '.$thumbnumber.'\', \''.get_permalink($wppost->ID).'\', \''.get_video_thumbnail($wppost->ID).'\')'Code: Select all
$data = array(
'title' => '<a class="one" href="'.get_permalink($wppost->ID).'" title="'. $title_attr .'" onMouseOver="setpage(\'thumb' .$thumbnumber.'\', \''.get_permalink($wppost->ID).'\', \''.get_video_thumbnail($wppost->ID).'\')"><span class="wpp-post-title">'. $tit .'</span></a>',
'summary' => $post_content,
'stats' => $stats,
'img' => $thumb,
'id' => $wppost->ID,
'posttime' => '<span class="wpp-post-time"> (\''.get_field('video_time', $wppost->ID).'\')</span>'
'javascriptcode' => 'setpage(\'thumb' '.$thumbnumber.'\', \''.get_permalink($wppost->ID).'\', \''.get_video_thumbnail($wppost->ID).'\')'
);