i am having a string in a variable similar to $school="bal bharti vidhya mandir"; i want to change this string into 'bal-bharti-vidhya-mandir'.Is it possible?I also need its reverse in my project.

Member Avatar
diafol

have a look at str_replace()

use str_replace or u can explode the string and implode it again.