Maxi-Pedia Forum

Information Technologies and Systems (IT/IS) => Other, SEO: Feel free to build your links here => Topic started by: mismas on November 10, 2008, 01:37:09 pm



Title: how to loop through a string
Post by: mismas on November 10, 2008, 01:37:09 pm
Just wondering if someone has a quick how to on how to loop through a string in PHP.

Example:

I have a string

Quote
$mystring = "testabcd";

and I want to loop through it and evaluate each character.

Evaluate t and do something. Then evaluate e and do something. Then evaluate s and do something, and so on.


Title: Re: how to loop through a string
Post by: mod on November 17, 2008, 02:14:57 pm
We just published an article on this, see here:

PHP loop through string
http://www.maxi-pedia.com/PHP+loop+through+string (http://www.maxi-pedia.com/PHP+loop+through+string)


Title: Re: how to loop through a string
Post by: aliatwa2020 on January 18, 2011, 01:08:40 am
Great article, thanks. This is a great site.