seany123 Posted June 21, 2009 Share Posted June 21, 2009 im getting the above error on this line. $icon = "<img src=\"images/forums/icons/NewPost.png\" width=\"75%\" alt=\"{$check->recordcount()} New Post(s)\">"; can anyone fix this for me? Link to comment https://forums.phpfreaks.com/topic/163077-solved-parse-error-syntax-error-unexpected-expecting/ Share on other sites More sharing options...
kickstart Posted June 21, 2009 Share Posted June 21, 2009 Hi Bodge solution, try this:- $icon = "<img src=\"images/forums/icons/NewPost.png\" width=\"75%\" alt=\"".$check->recordcount()." New Post(s)\">"; All the best Keith Link to comment https://forums.phpfreaks.com/topic/163077-solved-parse-error-syntax-error-unexpected-expecting/#findComment-860444 Share on other sites More sharing options...
JasonLewis Posted June 21, 2009 Share Posted June 21, 2009 You'll have to concatenate the part the includes the method. $icon = "<img src=\"images/forums/icons/NewPost.png\" width=\"75%\" alt=\"" . $check->recordcount() . " New Post(s)\">"; edit, kickstart got there. Link to comment https://forums.phpfreaks.com/topic/163077-solved-parse-error-syntax-error-unexpected-expecting/#findComment-860445 Share on other sites More sharing options...
PFMaBiSmAd Posted June 21, 2009 Share Posted June 21, 2009 Actually, you can put class methods and class variables in a double quoted string (at least in php5.) The original posted code works for me. It is likely that error is cause by the lines immediately before the line with the error. Post at least 5 lines before that point. Link to comment https://forums.phpfreaks.com/topic/163077-solved-parse-error-syntax-error-unexpected-expecting/#findComment-860449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.