Sunday 15 February 2015

How to put pointer in the desired place in a stream using PHP? -


Currently, I am creating a data parser using PHP through Telnet connection. I have had a problem: I should put the pointer in a stream (not to the end of the data) in some places, but it is impossible to use the function () function using the stream. Please tell me that I have this problem How can I solve this?

This function moves your stream cursor to the desired location:

  function Strikers (and $ FP, $ offset) {for ($ i = 0; $ i & lt; $ offset; $ i ++) fgetc ($ fp); } // Use this as: $ curPos = 459; $ Desired POS = 1345; MoveStreamCursorTo ($ yourstream, $ desired POS - $ curPos);  

Please check it and report your results.


No comments:

Post a Comment