I ran into a little problem today when I was creating a really quick script to scan lines files in a user specified directory for //todo:
...
So I had a line like this:
if (stripos($data, '//todo:')) { //case-insensitive search ^^
//deal with the data appropriately
}
This did not find //todo:
anywhere in any of the files! This was quite a surprise. I eventually ended up changing this line to remove the double forward slash (//
) and it worked. Though this will now also match lines that are not comments that contain this string, perhaps not a common occurrence (and it'll likely never happen to me) but still possible.
I have no idea why this happened and would greatly appreciate an explanation.