Counting between characters...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

Counting between characters...

Post by Mr. Tech »

Lets say this is my text:
{PAGE0}

This is page zero.... kewl...

{PAGE1}

This is page 1

{PAGE2}

This is page 2

{PAGE 3}

This is page 3

{PAGE4}
What I want to do is count how many {PAGE}'s there are on the page which is 5. How would i do this?

Thanks
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Code: Select all

$var = substr_count($string,"{page");
Post Reply