$out = basename($file, ".html") . ".com";
fairly limited i think, but simple.
Nothing wrong with being simple, and therefore both fast and easy to
understand by a wider audience. The only downer I can immediately think
of though is that whitespace isn't accommodated, but who really ends a
fi
steve wrote:
On Tuesday 08 January 2008 20:30:29 Chris wrote:
I usually use preg_* functions so here's my go:
echo preg_replace('/\.php$/', '.com', $file);
The '$' at the end makes sure it's a .php file and won't cause problems
with files like xyz.php.txt .
(otherwise I'd just use a str
On Tuesday 08 January 2008 20:30:29 Chris wrote:
>I usually use preg_* functions so here's my go:
>echo preg_replace('/\.php$/', '.com', $file);
>The '$' at the end makes sure it's a .php file and won't cause problems
>with files like xyz.php.txt .
>(otherwise I'd just use a straight str_replac
steve wrote:
I have a dir of html files that link to websites, i would like to read the dir
and print a list of those files as a link. Which the script i have does. I
would like to take this one step further and replace the ".html" extension
with ".com" so it winds up being:
website.com instea
On Jan 8, 2008, at 5:45 PM, steve <[EMAIL PROTECTED]> wrote:
I have a dir of html files that link to websites, i would like to
read the dir
and print a list of those files as a link. Which the script i have
does. I
would like to take this one step further and replace the ".html"
extension
- Original Message -
From: "William Glenn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 10:34 AM
Subject: [PHP] Ereg help
Hey all,
I've been fighting this all night, I need a bit of help. I have a string like.
#21-935 Item Description: $35.95
Where the pa
Something like this will work:
eregi("^id \{([a-z]*),([a-z]+),([a-z]+)\} \[(.+)\]$", $str, $regs);
$regs will be an array containing:
[0] => "id {name,title,nick} [http://www.php.net]";
[1] => "name"
[2] => "title"
[3] => "nick"
[4] => "http://www.php.net";
If course this isn't very foolproof
This is a good starter about PHP and regular expressions.
http://www.phpbuilder.com/columns/dario19990616.php3
>- Original Message -
>From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001 6:35 PM
>Subject: [PHP] ereg help
>
>
>> I'm
Try this,
while ($file_name = readdir($dir2)) {
if ($file_name!="." && $file_name!=".." && $file_name!="head.jpg" &&
!ereg(^tn_,$file_name)) {
$files[]=$file_name;
}
}
$numfiles = count($files);
for ($i=$g; $i<$numfiles; $i++){
echo $files[$i];
}
Tom
At 09:45 PM 7/14/01 -0400, you wrote:
>
9 matches
Mail list logo