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 977053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:50:32+00:00 2026-05-16T03:50:32+00:00

I am having a problem passing a json string back to a php script

  • 0

I am having a problem passing a json string back to a php script to process.

I have a json string that’s been created by using dojo.toJson() that contains a / and looks like this:

[{"id":"2","company":"My Company / Corporation","jobrole":"Consultant","jobtitle":"System Integration Engineer"}]

When I pass the string back to the php script it get’s chopped at the / and creates a malformed json string, which then means I can’t convert it into a php array.

What is the best way of escaping the / in this string? I was looking at regular expressions and doing a string.replace() however my regex isn’t that strong, and I’m not sure if there are better ways of doing this?

Many 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-05-16T03:50:33+00:00Added an answer on May 16, 2026 at 3:50 am

    You shouldn’t need to do anything special to represent a / in JSON – a string can contain any character except a " or (when not used to start an escape sequence) \.

    The problem is possibly therefore in:

    • the way you parse the JSON server side
    • the way your parse the HTTP data to get the JSON string
    • the way you encode the string before making the HTTP request

    (I’d bet on it being the last of those options).

    I would start by using a tool such as LiveHttpHeaders or Charles Proxy to see exactly what data is sent to the server.

    (I’d also expand the question with the code you use to make the request, and the code you use to parse it at the other end).

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

Sidebar

Related Questions

I'm having a recursion problem in Javascript. I have some JSON that I'm passing
I'm having a problem passing strings that exceed 80 characters in JSON. When I
I am having a problem with views. I have a view and am passing
Hey, I am having a problem deserializing base64 json back into the .net object
I'm having a problem trying to return a specific record using jQuery and JSON.
m having problem in passing parameter to controller action, i have done the following
I'm having a problem passing pointers to native code using COM. I want to
I'm having a problem passing parameters that I think I should be able to
I'm having a problem when passing nulls to a ExecuteCommand() method using linq. My
I am having a problem passing an NSError object back. The first line of

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.