Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:26:15+00:00 2026-06-06T07:26:15+00:00

I am working with a PHP version the Pinterest Pin It button and I’m

  • 0

I am working with a PHP version the Pinterest Pin It button and I’m running into a problem with the “description” portion of the url…

I’m using php to generate the url:

$pinurl = 'http://foo.com';
$pinmedia = 'http://foo.com/picture.jpg';
$pindesc = 'my description with #hashtag';

$pin = 'http://pinterest.com/pin/create/button/?url='.$pinurl.'&media='.$pinmedia.'&description='.$pindesc.'';

echo '<a href="'.$pin.'" class="pin-it-button" count-layout="none" target="_blank">Pin It!</a>';

The problem I run into is when my $pindesc variable has a hashtag in it or only a hashtag, Pinterest doesn’t read it from the url because it looks like:

http://pinterest.com/pin/create/button/?url=http://foo.com&media=http://foo.com/foo.jpg&description=#foo

So obviously the #foo isn’t being read as a description…

I was wondering if there’s some sort of work around or if I could use an “if” statement to run through my $pindesc variable to check for and replace hashtags with “%23” which is “url friendly”

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:26:17+00:00Added an answer on June 6, 2026 at 7:26 am

    You can use urlencode to convert any tricky characters in your script:

    $pindesc = urlencode('my description with #hashtag');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using php version 5.3.8 And mktime is not working for me here
I'm upgrading my local version of PHP to 5.3.2, on Windows. I'm running Apache
I'm using PHP version 5.3.2 on both my local development server and remote web
The Goal: have a working version of PHP with the GD library working on
PHP CLI has suddently stopped working on the server. When running any php file
Can anybody please suggest how to know the minimum PHP version, for working of
Possible Duplicate: How to enable PHP short tags ? I am using php version
HI all Running PHP Version 5.2.11 and we've been given a site which we're
Trying to get the content of the a certain URL using cURL and PHP.
My servers php version is 5.2.9, i'm uploading some pictures into my site, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.