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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:13:24+00:00 2026-05-21T10:13:24+00:00

Think I’m missing a basic concept. I want to generate html by traversing through

  • 0

Think I’m missing a basic concept. I want to generate html by traversing through a few different arrays of data. They don’t use numbers as indexes so numerical looping doesn’t work. I cant figure out how to use a foreach() here either. How can I traverse $price and $description when the indexes aren’t numbers?

Sample:

$traverser= 0;
while($traverser < $number_of_records)
{
    print $traverser . " - " . $price[$traverser] . "<br />";
    print $description[$traverser];
    $traverser++;
}

Partial Sample of the Array Structure:

object(phpQueryObject)#2799 (13) { ["documentID"]=>  string(32) "1d62be942498df890cab4ccb78a007a2" ["document"]=>  &object(DOMDocument)#3 (0) { } ["charset"]=>  &string(5) "utf-8" ["documentWrapper"]=>  &object(DOMDocumentWrapper)#2 (17) { ["document"]=>  &object(DOMDocument)#3 (0) { } ["id"]=>  string(32) "1d62be942498df890cab4ccb78a007a2" ["contentType"]=>  string(9) "text/html" ["xpath"]=>  &object(DOMXPath)#4 (0) { } ["uuid"]=>  int(0) ["data"]=>  array(0) { } ["dataNodes"]=>  array(0) { } ["events"]=>  array(0) { } ["eventsNodes"]=>  array(0) { } ["eventsGlobal"]=>  array(0) { } ["frames"]=>  array(0) { } ["root"]=>  &object(DOMElement)#5 (0) { } ["isDocumentFragment"]=>  &bool(true) ["isXML"]=>  bool(false) ["isXHTML"]=>  bool(false) ["isHTML"]=>  bool(true) ["charset"]=>  &string(5) "utf-8" } ["xpath"]=>  &object(DOMXPath)#4 (0) { } ["elements"]=>  array(560) { [0]=>  object(DOMElement)#2239 (0) { } [1]=>  object(DOMElement)#2240 (0) { } [2]=>  object(DOMElement)#2241 (0) { } [3]=>  object(DOMElement)#2242 (0) { } [4]=>  object(DOMElement)#2243 (0) { } [5]=>  object(DOMElement)#2244 (0) { } [6]=>  object(DOMElement)#2245 (0) { } [7]=>  object(DOMElement)#2246 (0) { } [8]=>  object(DOMElement)#2247 (0) { }
  • 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-21T10:13:25+00:00Added an answer on May 21, 2026 at 10:13 am

    Since it looks like you need the array keys as well, since you’re referencing multiple different arrays, you want the $a as $k => $v syntax for foreach:

    foreach($description as $key => $desc)
    {
        print $key . " - " . $price[$key] . "<br />";
        print $desc;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Think of a small and basic affiliate system. I want an URL like www.myshop.com/mynewproduct.html?afid=123
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Think Global, Act Local That's what they tell you, however during all my time
Think tic-tac-toe. You are creating the buttons in rows and columns and you want
think this should be an easy one... I want to get the currently selected
I think they are same thing but my boss say that is not right.
Think about a table like this ID Value 100 1 100 3 101 1
Think that says it all?
Think about a speedometer, and imagine all these little strokes around it like 10
Think 2 entities OneToOne mapped. Person and Car. A Person can have a Car.

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.