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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:28:47+00:00 2026-06-13T05:28:47+00:00

I am using an API call that returns an array. It’s an array not

  • 0

I am using an API call that returns an array. It’s an array not a sting. I want to wrap the array in an unordered list. I need two separate lists.

1) I want to wrap everything (including sub arrays) in an unordered list.

<ul>
  <li>[name]</li>
  <li>[name]</li>
  <li>[name]</li>
</ul>

2) I just want to wrap [name] in an unordered list.

<ul>
  <li>[1347037874]</li>
    <ul>
      <li>[level_id]</li>
      <li>[name]</li>
      <li>[canceled]</li>
      <li>[cancelDate]</li>
      <li>and all the rest</li>
    </ul>
  <li>[1347037874]</li>
    <ul>
      <li>[level_id]</li>
      <li>[name]</li>
      <li>[canceled]</li>
      <li>[cancelDate]</li>
      <li>and all the rest</li>
    </ul>
</ul>

I assign the API call like this:

$member_id = $logged_in_WP_user_id;
$member_levels = member_levels($member_id);

For explanation only (this line is not in my function…when I output $member_levels like this: htmlspecialchars(print_r(get_member($member_id),true)) I get the following:

Array
( 
    [1347037874] => stdClass Object
        (
            [Level_ID] => 1347037874
            [Name] => HFM-Cardiac Resistance Training Program
            [Cancelled] => 
            [CancelDate] => 
            [Pending] => 
            [UnConfirmed] => 
            [Expired] => 
            [ExpiryDate] => 
            [Active] => 1
            [Status] => Array
                (
                    [0] => Active
                )

            [Timestamp] => 1349804951
            [TxnID] => WL-2-1347037874
        )

    [1347037875] => stdClass Object
        (
            [Level_ID] => 1347037875
            [Name] => HFM-Official Heart Health Guide
            [Cancelled] => 
            [CancelDate] => 
            [Pending] => 
            [UnConfirmed] => 
            [Expired] => 
            [ExpiryDate] => 
            [Active] => 1
            [Status] => Array
                (
                    [0] => Active
                )

            [Timestamp] => 1349804951
            [TxnID] => WL-2-1347037875
        )
)

I have tried several ways to wrap the array in an array, it get close but still can make it work right.

Tks!

p.s. here is what I am now using to make the first list but how do I get the other key values to display as in unordered list under the key value =>Name.

$member_levels = ember_levels($member_id);

  $output  = '';    
  $output .= '<ul>';                            
  foreach($member_levels as $level) {
    $output .= '<li>' . $level_array[]=$level->Name . '</li>';
  }
  $output .= '</ul>';

  print_r($output);
  • 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-13T05:28:48+00:00Added an answer on June 13, 2026 at 5:28 am
    foreach($member_levels as $level)
    {
    
      $level_array[]=$level->Level_ID;
      $name_array[]=$level->Name;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Facebook API has a call $facebook->api_client->friends_getAppUsers(); and that returns the friend ids of
I'm working on an API call with Flickr, that returns results per photo like:
I am using the Win32 API call SetForegroundWindow to set focus to another application's
I'm currently using the ShowCursor API call to hide a cursor for an application
I'm attempting to expose a single API call using three different authentication mechanisms: django's
I'm using Bing API to search for images by going the following call: http://api.bing.net/json.aspx?AppId=[my
I am trying to call magento api using Soap from android but I am
I'm using shell_exec() to execute a Twitter API Call. shell_exec('curl -u user:password -d id=3191321
i am using your api and i have made a success call to upload
I am trying to use to a PUT call to a API using JSON.

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.