<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Array on Thaimeo Blog</title><link>https://blog.thaimeo.info/tag/array/</link><description>Recent content in Array on Thaimeo Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 17 Sep 2009 04:38:21 +0000</lastBuildDate><atom:link href="https://blog.thaimeo.info/tag/array/index.xml" rel="self" type="application/rss+xml"/><item><title>php tip</title><link>https://blog.thaimeo.info/2009/09/17/php-tip/</link><pubDate>Thu, 17 Sep 2009 04:38:21 +0000</pubDate><guid>https://blog.thaimeo.info/2009/09/17/php-tip/</guid><description>$str = “home::khanhpt::test.tar.gz”; $data = explode(“::”,$str); $data[0] = “root”; $name = join(“::”,$data); echo $name; You could use a regular express to remove everything apart from those characters you wish to keep: $string=preg_replace(‘/[^A-Za-z0-9 _-+&amp;amp;]/’,”,$string); Replaces everything that is not (^) the letters A-Z or a-z, the numbers 0-9, space, underscore, hypen, plus and ampersand – with … Read more</description></item></channel></rss>