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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:57:32+00:00 2026-06-03T07:57:32+00:00

So a PHP file returns a string ( to an ajax call ) like

  • 0

So a PHP file returns a string ( to an ajax call ) like this :

$output = $sessID."###".$sessEmail."###".$sessFirstName."###".$sessLanguage."###".$sessRememberMe;

and in javascript i do :

    if (reply.indexOf("###") >= 0) {
    arrayReply = reply.split("###");
    user.ID = arrayReply[0];
    user.Email = arrayReply[1];
    user.FirstName = arrayReply[2];
    user.Language = arrayReply[3];
    user.RememberMe = arrayReply[4];
    }

a problem can arise when parts of reply contain the the delimiter i use “###”. What can I do in such a situation? Making the delimiter more complex/rare is not a solution in my opinion.

PS: I did try JSON but it’s WAY SLOWER server side.

FINAL EDIT:

server side JSON is slower, and the same for client side, however it’s not going to be a bottleneck ( 430ms for 100.000 calls ) and plus there is no need as Jules said below to re-invent the wheel. There was one more solution: bin2hex() in php [which reduced the time from 430ms to 240] and then get back the string in javascript with a hex2string function, however not worth the effort. JSON it is. Thank you all!

  • 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-03T07:57:34+00:00Added an answer on June 3, 2026 at 7:57 am

    You can use json.

    http://php.net/manual/en/function.json-encode.php

    How to JSON decode array elements in JavaScript?

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

Sidebar

Related Questions

I have a php file that returns a string like this [item1,item2,item3,item4] I need
I'm doing a jQuery Ajax call to a PHP script that returns this string
I have an AJAX request on a php file, which returns some data, like
I have a php file that returns a div and a javascript. I want
Jquery Ajax Call inserts new record on DB. File been called (php) needs to
I have a PHP file that returns a JSON array. I need to extract
I have a PHP file which will return something like <div id=title>Add Us On
i've used .load() with jquery to call a php file that will return search
My included file (include.php) is this: <?php $myarray=(a,b,c); shuffle($myarray); ?> My main php file
The problem I want to delete a file with AJAX/PHP . But the php

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.