I need to search for a string in a string and get the part behind that (without spaces).
Example:
This ABC-Code: 12 3 45
Another ABC-Code: 678 9
Now I'm searching for the keyword ABC-Code:
and I want to get the numbers after that (deleting spaces), so the result would be:
12345
6789
I tried to solche that with substr(), but the problem is, that previous characters are variable. So I think I have to use a RegEx, like this:
preg_match("#ABC-Code:(.*?)\n#", $line, $match);
trim($match); // + remove spaces in the middle of the result