PHP Read txt problem 2

Source: Internet
Author: User
I want to read the A.txt in the second $, to the third appear between the data how to get thank you!!! ($ is not a separate character: Maybe it's a 1$711197, or maybe it's a false$711197, not the same format) Thank you.


Reply to discussion (solution)

$r 0 = Explode ("$", $row []);//segment, $r 0[1] is all characters after the first $
$r 1 = Explode ("$", $r 0[1]); Segment, $r 1[0] is the second $ preceding all characters

1. One byte read out;
2. Compare with ' $ ';
3. After the first occurrence, save the subsequent bytes to the string one at a time until the second occurrence of ' $ '.

$s =file_get_contents (' a.txt '); $arr =explode (' $ ', $s); Echo $arr [2];
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.