Results 1 to 3 of 3
-
12-09-2014, 03:05 PM #1WHT Addict
- 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
-
12-09-2014, 03:50 PM #2Junior Guru Wannabe
- 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], 0, 10); // Put the delimiter back and keep only 10 chars
-
12-24-2014, 10:11 AM #3Junior Guru Wannabe
- Join Date
- Dec 2014
- Posts
- 34
Try regex, it will help you find all the 999xxx strings for you.
Similar Threads
-
Help to find server with specific needs
By AlexMaker in forum Dedicated ServerReplies: 15Last Post: 04-14-2012, 01:50 AM -
using find command with regex to find all number-only filenames?
By chamelion in forum Hosting Security and TechnologyReplies: 10Last Post: 10-22-2007, 06:41 AM -
4 char number.com domains
By Division Host in forum Domain NamesReplies: 20Last Post: 12-07-2003, 08:29 PM -
Super SEXY and short - Premium 3-char .COM domains for sale - LETTER-NUMBER-NUMBER
By Acroplex in forum Other Offers & RequestsReplies: 8Last Post: 04-24-2003, 12:46 PM -
How to add specific number of loops to flash (SWISH) animation
By ingepo in forum Web Hosting LoungeReplies: 1Last Post: 11-28-2002, 03:25 AM