954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

split the word

i want to break the word
for example

Health-and-Fitness:Weight-Loss
i ant to break into two parts
healt-and -fitness
and

weight-loss

weathei have to use str_split. if i use it is not spliting

any bodu please help me

aarya
Junior Poster
139 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

What are the rules for the split, number of characters, the semi colon?

If it's the semi colon take a look at explode

sarahk
Junior Poster
144 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

Expanding on Sarahk's response:
[PHP]$input = 'Health-and-Fitness:Weight-Loss';
list($category,$subcategory) = explode(':',$input);
/*
results:
echo $input => Health-and-Fitness:Weight-Loss
echo $category=> Health-and-Fitness
echo $subcategory=> Weight-Loss
*/[/PHP]

Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You