"12345" is dynamically written in a file to be included so I need to find the first 6 characters after "i:" so I can get:
char 1 = " ", char 2 = "1", char 3 = "2" and so on for the first 6 characters after a unique "i:" in the document that is being included where the numbers after i:, are dynamically generated and there could be up to 99999 different values.
I need to get that dynamically generated number, I have been tried to find a solution for days and could not find one yet.
This is what I have so far:
Code: Select all
$str = "i: $dynamic_number";
preg_match('/(?<name>\w+): (?<digit>\d+)/', $str, $matches);
print_r($matches);