I guess the issue is that I don't really need to know where it is, or if there is more than one ":" -- I just need to be able to get at everything that precedes the ":" -- so usingEverah wrote:You really can't do anything about it without knowing where it is or going after it in some capacity. You can use regexp or you can use strpos() if you know there will only be one colon in the string.
Code: Select all
$precolon = explode(":", $books[2]);Looking on the manual page for strpos() there are examples for getting text from between two strings... would I take that sort of approach and just use -1 as the starting position and ":" as the ending string?