PHP text parsing functions? how do I do Middle() and Position() in PHP?

In my native development environment, I make heavy use of text-parsing functions, especially Middle and Position.

Middle ==> Let (string = “some big ugly block of text you’re parsing”; Middle (string, startposition, number of chars) )

Position ==> Let (string = “some big ugly block of text you’re parsing”; Position (string, “search string”, starting from, which occurrence).

Concrete example:

Let (title = “PHP text parsing functions? how do I do Middle() and Position() in PHP?”;

Middle (title, Position (title, “?”, 1, 1)+2, Position (title, “PHP”, 1, 2)-Position (title, “?”, 1, 1)-3)
)

yields “how do I do Middle() and Position ()”

What would be the PHP equivalents of Middle() and Position(), and their syntax?

Also of use would be PatternCount(), or a PatternCount() equivalent. You know, ==>

PatternCount (string, "PHP)

yields 2 using the thread title again as ‘string’.
ETA: I did Google, just not with much success.

I’m not a big PHP maven, but I do have a little google-fu I think.

Try here: PHP String Functions and look at:

substr() for Middle()
strstr() for Position()

Hope that this helps.

substr (substring) and strpos (string position).

That totally rocks! Thanks!