Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Anybody offer some help to me?

    Hey... could anybody help me with this please?

    I can't remember the function to reverse the way in which data is inputted into a file - for example, data may be at the bottom but there's something that reverses it that makes it appear at the top of the file. I've forgotten what it is, can anybody give me some help? Thanks.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,077
    Thanks
    11
    Thanked 98 Times in 96 Posts
    sorry can you be more specific ? a text file ? an array ? not quite with you ...
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If we are talking about files here, you will have to assign the data to a variable, open the file, read its contents, append them to previously mentioned string variable and rewrite the file with the new string variable as new contents.

  • #4
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's a text file. Thanks.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $newdata = file('your.txt');
    $newdata = array_reverse($newdata);

    G


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •