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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:44:52+00:00 2026-05-23T08:44:52+00:00

I created a array using PHP $userarray = array(‘UserName’=>$username,’UserId’=>$userId,’UserPicURL’=>$userPicURL); How can I convert this

  • 0

I created a array using PHP

$userarray = array('UserName'=>$username,'UserId'=>$userId,'UserPicURL'=>$userPicURL);

How can I convert this array into a string in PHP and back from string into an array. This is kind of a requirement. Could someone please advice on how this can be acheived.

  • 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-23T08:44:52+00:00Added an answer on May 23, 2026 at 8:44 am

    You can convert any PHP data-type but resources into a string by serializing it:

    $string = serialize($array);
    

    And back into it’s original form by unserializing it again:

    $array = unserialize($string);
    

    A serialized array is in string form. It can be converted into an array again by unserializing it.

    The same does work with json_encode / –_decode for your array as well:

    $string = json_encode($array);
    $array = json_decode($string);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can create a sparse php array (or map) using the command: $myarray =
ive created a form and im using php to check if the username exists
I am trying to create a multi dimensional array using this syntax: $x[1] =
I've created a blog main page using PHP and have included a sidebar and
i have created a simple web service using Php Nusoap. its working correctly but
Im using class.twitter.php ( http://emmense.com/php-twitter/documentation/v11-methods-available/ ) Im using this code: $summize = new summize;
Hi I'm using fullCalendar 1.5.1, and I've created a PHP query that returns almost
I am using this wonderful bit of code created by jackreichert . This in
How can I get real host name by not using $_SERVER['SERVER_NAME'] in PHP? Is
So I am using the facebook-php-sdk and I have created a page tab On

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.