A
A
Alex Ivanov2016-02-15 03:58:27
Parsing
Alex Ivanov, 2016-02-15 03:58:27

How to parse a string with commas?

Help with a task. There is a line $str="Катя, Валя, Таня, Настя"; I need to make her

$new_str="<a href=\"Катя\">Катя</a>, <a href=\"Валя\">Валя</a>, <a href=\"Таня\">Таня</a>, <a href=\"Настя\">Настя</a>";
. Help me write a preg_replace rule

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-02-15
@Protossan

ideone.com/yaqeXy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question