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

  • SEARCH
  • Home
  • 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 7713003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:45:49+00:00 2026-06-01T01:45:49+00:00

I have a url that looks like that http://example.com/index.php?id=111&title=word1 word2 word3 I need to

  • 0

I have a url that looks like that

http://example.com/index.php?id=111&title=word1 word2 word3

I need to encode the spaces before requesting the url with curl.

But how to urlencode the right parts of the url.

urlencode and rawurlencode encode the slashes of https the question mark etc.

  • 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-01T01:45:50+00:00Added an answer on June 1, 2026 at 1:45 am

    You can use parse_url() to split the URL into its respective pieces. Use urlencode() on the query element from the array that parse_url returns, then put it back together using http_build_url.

    NOTE: http_build_url requires PECL pecl_http >= 0.21.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a url that looks like this http://example.com/index.php ?con=something&met=meh What i'm trying to
I have url that looks like this... http://www.example.com/accounts/?token=111978178853984|683b8096732be7fd725d3332-557626087|m9lSbmoYhZ6Yut4OC3smY1fRf1E. from the token 111978178853984|683b8096732be7fd725d3332- 557625434 |m9lSbmoYhZ6Yut4OC3smY1fRf1E
For example, I have an URL that looks for an image like this: http://example.com/img/foo.png
I have a line of text that looks like this foo bar http://www.example.com ->
If I have an XML file that looks like this: <properties> <property> <picture>http://example.com/image1.jpg</picture> <picture>http://example.com/image2.jpg</picture>
To use flickr as an example, a request URL looks something like this: 'http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key='
I know how to make URL's rewrite, for example: www.example.com/index.php?id=1&cat=3 to www.example.com/1/3/ (or whatever).
I have a method in a url rewriting module that looks like this public
I have a CSS entry that looks like this: .header { background-image: url(./images/embouchure.jpg); background-repeat:
I have a simple form that looks like so <% remote_form_for post, :url =>

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.