Welcome to Maxi-Pedia Forum. Maxi-Pedia discussion forum is a free community inviting you to express your ideas and discuss various topics with other contributors.

October 20, 2021, 02:45:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Most Recent Posts:
Pages: [1]
  Print  
Author
Topic: 

how to loop through a string

 (Read 6991 times)
mismas
Jr. Member
**
Posts: 60


« 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.
Logged
Maxi-Pedia Forum
« on: November 10, 2008, 01:37:09 pm »

 Logged
mod
Moderator
*****
Posts: 526


« Reply #1 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
Logged
aliatwa2020
Semi-Newbie
*
Posts: 6


« Reply #2 on: January 18, 2011, 01:08:40 am »

Great article, thanks. This is a great site.
« Last Edit: January 18, 2011, 12:54:17 pm by aliatwa2020 » Logged
Maxi-Pedia Forum
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Page created in 0.076 seconds with 30 queries. (Pretty URLs adds 0.001s, 0q)