Hrky Posted July 18, 2015 Share Posted July 18, 2015 Please Help, im tired and cant seem to find the parse error, to me it seems fine but it is showing me it like on pic i attached public function getBlock( $tag ){ //echo $tag; preg_match (‚#<!-- START ‚. $tag . ‚ -->(.+?)<!-- END ‚. $tag . ‚ -->#si', $this->content, $tor); $tor = str_replace (‚<!-- START ‚. $tag . ‚ -->', „", $tor[0]); $tor = str_replace (‚<!-- END ‚ . $tag . ‚ -->', „", $tor); return $tor; } Quote Link to comment https://forums.phpfreaks.com/topic/297348-nasty-parse-error/ Share on other sites More sharing options...
Solution Ch0cu3r Posted July 18, 2015 Solution Share Posted July 18, 2015 Not sure why but you are using commas, where you should be using quotes, highlighted below preg_match (‚#<!-- START ‚. $tag . ‚ -->(.+?)<!-- END ‚. $tag . ‚ -->#si', $this->content, $tor); ^ ^ ^ ^ ^ | | | | | +------------+---------+ -----------------+---------+ | These commas should be single quotes not commas Quote Link to comment https://forums.phpfreaks.com/topic/297348-nasty-parse-error/#findComment-1516695 Share on other sites More sharing options...
Hrky Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) Omg i feel so stupid now hahah i fixed it thanks if anyone is intersted here is the fixed code Thanks again public function getBlock( $tag ) { preg_match ('#<!-- START '. $tag . ' -->(.+?)<!-- END '. $tag . ' -->#si', $this->content, $tor); $tor = str_replace ('<!-- START '. $tag . ' -->', "", $tor[0]); $tor = str_replace ('<!-- END ' . $tag . ' -->', "", $tor); return $tor; } Edited July 18, 2015 by Hrky Quote Link to comment https://forums.phpfreaks.com/topic/297348-nasty-parse-error/#findComment-1516700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.