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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:33:29+00:00 2026-06-17T12:33:29+00:00

I am using this code for reading data from any file but if i

  • 0

I am using this code for reading data from any file but if i want to read data from excel sheet then what should i do?

<?php 
   if(isset($_POST['submit'])){
      $cir="certificate";
      if(!is_dir($cir)){
           mkdir($cir);
      }
      $image1=$_FILES['cir']['name'];
      $image=$_FILES['cir']['tmp_name'];
      $server_path=$cir.'/'.basename($_FILES['cir']['name']);
      $s=move_uploaded_file($image,$server_path);
     if($s){
        //echo "successfully uploaded.";
        $file_open=fopen("$cir/$image1","r");
        $file_read=fread($file_open,filesize("$cir/$image1"));
        echo $file_read;
        //$data = substr(strrchr("$cir/$file_read", ","),5 );
        echo $file_read;
     }else{
        echo "problem in uploading.";
     }
   }
?>
<html>
     <body>
         <form name="form" method="post" enctype="multipart/form-data">
             <input type="file" name="cir" /><br />
             <input type="submit" name="submit" value="submit" />
         </form>
    </body>
</html>

Excel sheet containing various shells like Name-XYZ, s.no-123 etc. I want that xyz should be put on a variable and 123 should be on another variable. What will be code in PHP?

  • 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-17T12:33:30+00:00Added an answer on June 17, 2026 at 12:33 pm

    If your site involves reading excel files extensively then go for a library like https://github.com/PHPOffice/PHPExcel . It supports both xls and xlsx types.

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

Sidebar

Related Questions

i am reading an excel file using this code i found over the net:
I am using C to open a file for reading. I have this code
Using This code: I am tring to fill the page with the data and
Im using this code: protected String getContactInfo() { Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, null,
I am writing to file in android and read from the same file using
I have a program that load data from a file using std::ifstream and store
I've this simple code: using(FileStream fs = new FileStream(@E:\test.bin, FileMode.Open, FileAccess.Read, FileShare.Read) { byte[]
I discovered a nice abstraction whereby I can read in data from UDP using
I'm trying to read and display a matrix from within an xml file, using
I want to create a xml file from the data given by the users.

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.