Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    167

    How to find specific number and get next 15 char ??

    Hello ,

    i have a text file like this :

    001001000100100010010010001110011110011999123456780001001000100100010010010001110011110011999123456781001001000100100010010010001110011110011999123456788001001000100100010010010001110011110011999123456789

    how to using php to get the next 10 char after the number 999 and then insert each record to table or send it to array??

    i would like the result to be like that :

    9991234567800
    9991234567810
    9991234567880


    thank you

  2. #2
    Join Date
    Nov 2014
    Location
    New York
    Posts
    74
    How about this?

    PHP Code:
    $string "..."// Your input string
    $delim "999"// Your delimiter
    $s array_slice(explode($delim$string), 1); // Get the pieces without the delimiter and the first piece
    for ($i 0$i sizeof($s); $i++)
        
    $s[$i] = $delim substr($s[$i], 010); // Put the delimiter back and keep only 10 chars 
    http://sandbox.onlinephpfunctions.co...a793be344a1266

  3. #3
    Join Date
    Dec 2014
    Posts
    34
    Try regex, it will help you find all the 999xxx strings for you.

Similar Threads

  1. Help to find server with specific needs
    By AlexMaker in forum Dedicated Server
    Replies: 15
    Last Post: 04-14-2012, 01:50 AM
  2. using find command with regex to find all number-only filenames?
    By chamelion in forum Hosting Security and Technology
    Replies: 10
    Last Post: 10-22-2007, 06:41 AM
  3. 4 char number.com domains
    By Division Host in forum Domain Names
    Replies: 20
    Last Post: 12-07-2003, 08:29 PM
  4. Replies: 8
    Last Post: 04-24-2003, 12:46 PM
  5. Replies: 1
    Last Post: 11-28-2002, 03:25 AM

Posting Permissions

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