faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

I have a string $string="Fred.html|Sanu|Sachin.html".I need to seprate the .html extensions?I

Mar 4th, 2005 04:09
TeraZen, Philip,


Use split() function;
http://ca.php.net/manual/en/function.split.php
For example;
$string="Fred.html|Sanu|Sachin.html";
$stringArray = split("|", $string);
$u = 0;
do {
   $url=$stringArray[$u];
   echo("$url<br>\n");
   $u++;
   if ($u == count($stringArray))
   {
       break;
   }
}
// it's ugly...