To guide the expression of a certain number of tests

Source: Internet
Author: User
Now want to open a text document with the content:

March 17, the daily turnover of 88471, an increase of 9511 yoy .....



Need to be 88471 after the turnover of the assigned value to $now, the year-on intercept to assign value to $bizhi, how to deal with it?


Reply to discussion (solution)

$s = ' March 17, daily turnover 88471, increase 9511, ... ';p reg_match_all ('/(\d+),/', $s, $r), List ($now, $bizhi) = $r [1];echo $now;/ 88471echo $bizhi;//9511

There was also a problem during the commissioning process

$file _name= "data.txt"; $s =file_get_contents ($file _name);


Data.txt inside is the content of the string, how to output is blank?

If your page is Utf-8, and the data.txt content is GBK
Then the output is blank .

So how can I handle this txt text? Automatically converted to GBK? All my pages are encoded in gb2312.

Your code for the relevant

Coding to be consistent

Open file Save a copy of Utf-8 encoded

  • Related Article

    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.