I get this error when I enter data in my form

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in

\functions.php on line 77

return '<span class="vwbx">Views</span>''<span class="vwbx">$count.</span>';

==== Whole function===

function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
    delete_post_meta($postID, $count_key);
    add_post_meta($postID, $count_key, '0');
    return "0 View";
return $count. '<span class="vwbx">Views</span>''<span class="vwbx">views</span>';

closed as too localized by fuxia Jun 15 '13 at 11:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.


The problem is that you have two strings that aren't actually being appended together.

Try replacing

return $count. '<span class="vwbx">Views</span>''<span class="vwbx">views</span>';


return $count. '<span class="vwbx">Views</span>'.'<span class="vwbx">views</span>';

(note the added period in the centre).

Or instead, remove the two quotation marks from the centre:

return $count. '<span class="vwbx">Views</span><span class="vwbx">views</span>';

That should work :D

EDIT In response to your comment... I think you'll be wanting to replace it with:

return '<span class="vwbx">Views</span><span class="bxarw"></span><span class="CntBx">'.$count.'</span>';
  • thanks Harris working but i need to do this, to get $count value like return '<span class="vwbx">Views</span><span class="bxarw"></span><span class="CntBx">$count.</span>'; – user8503 Jan 18 '12 at 14:23
  • 1
    I've edited my answer :D. By the way, you may want to start accepting answers to your questions - your score is very low and people may decide not to bother answering you. – Stephen Harris Jan 18 '12 at 14:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.