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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:47:52+00:00 2026-05-19T09:47:52+00:00

I am sure a silly question for you but a big one for me

  • 0

I am sure a silly question for you but a big one for me as I have just started learning programming.

My issue is like this:

I have multiple HTML files in a folder. Each file has 3 values in 3 lines (only 1 item in each line).

Line 1 : Title
Line 2 : Image Link
Line 3 : Details

I want to import these files to a jQuery based Ajax Tabs Script, I have and the XHTML part of it is like this:

<ul class="mytabs" id="tabs">
    <li class="current"><a href="./tabs/tab-1.html">Tab 1</a></li>
    <li><a href="./tabs/tab-2.html">Tab 2</a></li>
    <li><a href="./tabs/tab-3.html">Tab 3</a></li>
    <li><a href="./tabs/tab-1.html">Tab 4</a></li>
    <li><a href="./tabs/tab-2.html">Tab 5</a></li>
    <li><a href="./tabs/tab-3.html">Tab 6</a></li>

</ul>
<div class="mytabs-container" id="tabs-container">
    Loading. Please Wait...
</div>

What I want is to parse these HTML files and the Title in Tab’s Name position, Image Link and Details in the Tab Container and The link to that file in the href before tabs title so that the final product looks something lkike this:

<ul class="mytabs" id="tabs">
    <li><a href=<?php echo $linkToFile?>><?php echo $title ?></a></li>
</ul>
<div class="mytabs-container" id="tabs-container">
    Loading. Please Wait...
    <?php echo $imageLink?>
    <?php echo $details?>
</div>

I need a PHP or jQuery script which should do the following:

  1. Loop and get the contents of all the HTML files from the folder
  2. Fetch content in the form of a variable so that I can placed them as shown above.
  3. Fetch the link to file too as a variable so that it can also be placed as the link to tabs.

Is this possible? If yes how can I achieve that.

Kindly help.

  • 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-19T09:47:52+00:00Added an answer on May 19, 2026 at 9:47 am

    well, then, if you want to read a file in php, you can use something like:

    $myfile = 'info.htm';
    $lines = file($myfile);   
    $info = array('title'=>$lines[0], 'image'=>$lines[1], 'details'=>$lines[2]);
    echo '<h1>'.$info['title'].'</h1>
          <img src="'.$info['image'].'" alt="'.$info['title'].'"/>
          <p>'.$info['details'].'</p>';
    

    obviously, you have to run that for every .htm file

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

Sidebar

Related Questions

Guys I know this question is silly but just to make sure: Having in
I know this question is silly but I just want to make sure. Does
I've just started programming with Java, so might appear as silly question, but I
Not sure if this is a silly question, but I just noticed this: public
Sorry if this question sounds a little silly, but I am not sure what
This is quite probably a very silly question but I need to be sure.
I'm not exactly sure whether or not this is a silly question, but I
This might be a silly question, but I'm not sure how to tackle the
Ok, this might sound like a silly question, but I'm having all sorts of
This is a silly simple question I’m sure, but since I’m new to Magento,

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.