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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:33:22+00:00 2026-05-27T09:33:22+00:00

I would need help: I have an array and I need to get values

  • 0

I would need help:
I have an array and I need to get values from it…but how to get the data which are within curly brackets …

It should be something simple, I think … I tried with explode which obviously cannot work as I have for example within last curly brackets with two kinds of data, which should be distinguished as so…each curly bracket (with data applies to something).

$array = array(
  "other" => "{name:2},{value:2},{align:4},{height:4, color:red}",
  "another" => "{name:2},{value:2},{align:4},{height:4, color:red}"
);

I’m really struggling … and appreciate your help.
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-27T09:33:23+00:00Added an answer on May 27, 2026 at 9:33 am

    On the contrary, I think explode will work perfectly. Explode into separate strings and then for each string retrieve from index 1 to index [arraylength-1] since index 0 contains { and the last index contains }.

    $str = substr($str, 1, strlen($str)-1);

    So for each string cut out from index 1 to last_index-1.

    EDIT:

    AFter you do the first explode (which will cut it into 2 big chunks): chunk1 and chunk2

    foreach chunk array
    $pieces=explode(",",$chunk1);
    // or chunk 2 (this will further cut the pieces up into strings that were separated by ,)

    $str = substr($pieces, 1, strlen($pieces)-1);

    Then for each $piece, retrieve the content in between. (pseudo code)

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

Sidebar

Related Questions

I would need to get a Regular Expression, which matches all Unicode control characters
Can anyone help with converting data from an XML document into an associative array?
Ok need some help here. I have an autocomplete setup to pull from a
I would like to know how to get the values into this array. Can
I have an array of NSDates which I build from strings using [NSDate dateFromString]
I really need help with interfaces in general... Any resources that you guys would
I need some help. I am looking for a regex that would match the
I'm working on a tool which would need to communitacte: send and recieve files
I have a custom control Workspace that inherits from Control and within it is
I need a bit of help. I have (reference?) table with columns: id ,

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.