/    Sign up×
Community /Pin to ProfileBookmark

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()

[code=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]

[/code][/code]

The following script not working and shows result on facebook as ‘….’ rather than ‘$descpp + …..’

And I already debug via [URL=”http://developers.fa…com/tools/debug”]http://developers.fa…com/tools/debug[/URL] also.

And for

[code=html][code=php][CODE]<meta property=”og:description” content=”<?php echo $fetchForumData[0][‘descp’]; ?>” />[/CODE]

[/code][/code]… 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.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@maha_rafaauthorMay 28.2013 — Any Help?

Is this anything wrong with the code?

Or Any solution?

Thanks in Advance
Copy linkTweet thisAlerts:
@NogDogMay 28.2013 — 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).
×

Success!

Help @maha_rafa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...