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
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
Jump to PostWhat are the rules for the split, number of characters, the semi colon?
If it's the semi colon take a look at explode
Expanding on Sarahk's response:
$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
*/
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.