Issue
Please I've been trying my best to get this working but I can't figure it out. This is the code:
$image = $p['Photo']; ` <meta property="og:image" content="<?php echo htmlspecialchars("http://myurl.com/$image"); ?>" />`
Each time it runs, it shows http://myurl.com/../postphotos/image.png as the output instead of http://myurl.com/postphotos/image.png
Note: post photos are the actual folder where the images are.
Solution
$image = preg_replace('/^\.+\//', '', $p['Photo']);
<meta property="og:image" content="<?php echo htmlspecialchars("http://uamxtreme.com/$image"); ?>" />
Answered By - A. Eaxon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.