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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:58:28+00:00 2026-05-27T03:58:28+00:00

I need help with something i’m working on. I need my PHP code be

  • 0

I need help with something i’m working on.
I need my PHP code be able to read an uploaded file “A” and write a whole new file “B” with the very same words from A but in a different order

for example if A is

ABC 54 DOG 90 100
56 11 78 YOU 101
A C F H 99

B should be

DOG ABC 90 100 54
78 56 YOU 101 11
F A H 99 C

(so 3rd-1st-4th-5th-2nd. just an example)

What I had in mind was to do something like fwrite($B,JavascriptFunction($A))
but, once into the js part, I really don’t know how to take the right word and put it into the text variable that javascriptfunction have to return.
I know I have to use a .split(‘\n’) to deal with the different lines, but that’s as far as I’ve figured out so far. I know it is probably a silly question but i’m really new to JS.

Thank you

  • 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-27T03:58:29+00:00Added an answer on May 27, 2026 at 3:58 am

    I dont think you need Javascript to read file, but here it goes:

    var fileContent='';
    var theLocation='';
    
    function readFileViaApplet(n) {
     document.f1.t1.value='Reading in progress...';
     document.ReadURL.readFile(theLocation);
     setTimeout("showFileContent()",100);
    }
    
    function showFileContent() {
     if (document.ReadURL.finished==0) {
      setTimeout("showFileContent()",100);
      return;
     }
     fileContent=document.ReadURL.fileContent;
     alert(fileContent); // do what you want with the content
    }
    

    Hope it helps

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

Sidebar

Related Questions

I need some help with something that is probably very basic. I'm working on
I need help in creating a xml file from my php code. I created
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I'm new to ORM stuff and I need some help understanding something. Let's assume
Need help with my simple PHP menu. I'd like to have something like that:
I need help about array of structs initiliazation. In a code something like below,
I need a little help clearing something up with Zend_Form and adding filters to
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help with this route map routes.MapRoute(Blog_Archive, Blog/Archive/{year}/{month}/{day}, new { controller = Blog,
I need help to replace all \n (new line) caracters for in a String,

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.