dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Facebook Meta Tag - og:description for database value with strip_tags() and substr()

  1. #1
    Join Date
    May 2013
    Posts
    4

    Facebook Meta Tag - og:description for database value with strip_tags() and substr()

    Facebook Meta Tag - og:description for database value with strip_tags() and substr()

    HTML Code:
    [PHP][CODE]$descpp = substr($fetchForumData[0]['descp'], 0, 300)."...";
    // echo $descrp    {As it shows correctly as the description data from database limit to 300 words via echo}
    <meta property="og:description" content="<?php echo strip_tags($descpp); ?>" />  [/CODE][/PHP]
    The following script not working and shows result on facebook as '....' rather than '$descpp + .....'

    And I already debug via http://developers.fa...com/tools/debug also.

    And for
    HTML Code:
    [PHP][CODE]<meta property="og:description" content="<?php echo $fetchForumData[0]['descp']; ?>" />[/CODE][/PHP]
    ... its shows complete content on the top of the article page and after comment via facebook comment plugin it shows blank space on facebook timeline.

    What is missing? Kindly advice as soon as possible.

  2. #2
    Join Date
    May 2013
    Posts
    4
    Any Help?
    Is this anything wrong with the code?
    Or Any solution?

    Thanks in Advance

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    21,313
    So it sounds like you need to do some debugging to find out if $fetchForumData[0]['descp'] actually has any data at that point in the code, and if not, got back to where it gets set and find out why it's empty (after first making sure you're using the correct variable name and array keys).
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles