7 Replies - 505 Views - Last Post: 29 January 2012 - 05:58 AM Rate Topic: -----

#1 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

how to handle IO for text file php

Posted 29 January 2012 - 01:23 AM

HI all,

I want to hadnle IO for text file in PHP. I would like write my own methode for writing raading data to text file instead of using inbuilt methode.

Can I do that?


plz reply...


thx in advnce...
Is This A Good Question/Topic? 0
  • +

Replies To: how to handle IO for text file php

#2 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5072
  • View blog
  • Posts: 26,471
  • Joined: 10-May 07

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:28 AM

Are you talking about a serverside text file or something that a client will upload via their web-browser?
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3404
  • View blog
  • Posts: 9,625
  • Joined: 08-June 10

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:36 AM

View Postmenukadevinda, on 29 January 2012 - 09:23 AM, said:

Can I do that?

only when you step out of PHP and make another programme (shell, C, …) do it. in the end that will most likely end up more complicated and slower than using native PHP methods (that’s why there are so many PHP functions, to make it easier).
Was This Post Helpful? 0
  • +
  • -

#4 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:41 AM

thanks for the reply.

ok then do u know how to solve this problem

$myFile = "testFile.php";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 4);
fclose($fh);
echo $theData;




above fread($fh, 4) methode provide 4 bit data.

but I want to read data from with a starting and ending point of text file.
that's something like fread($fh, 4, 10);

then start from 4th char and end from 10th char

cheers...
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3404
  • View blog
  • Posts: 9,625
  • Joined: 08-June 10

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:50 AM

I already answered that question.
Was This Post Helpful? 1
  • +
  • -

#6 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:53 AM

View PostDormilich, on 29 January 2012 - 08:36 AM, said:

View Postmenukadevinda, on 29 January 2012 - 09:23 AM, said:

Can I do that?

only when you step out of PHP and make another programme (shell, C, …) do it. in the end that will most likely end up more complicated and slower than using native PHP methods (that’s why there are so many PHP functions, to make it easier).

though complicated or slower , how to start ?
Was This Post Helpful? -1
  • +
  • -

#7 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3404
  • View blog
  • Posts: 9,625
  • Joined: 08-June 10

Re: how to handle IO for text file php

Posted 29 January 2012 - 01:55 AM

read my answer in the other thread and decide, whether that is a path that can solve the problem.
Was This Post Helpful? 1
  • +
  • -

#8 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5960
  • View blog
  • Posts: 23,238
  • Joined: 23-August 08

Re: how to handle IO for text file php

Posted 29 January 2012 - 05:57 AM

Closed for being a duplicate of this topic
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1