Re: [PHP] World time convertor

2004-09-30 Thread Daniel Spain
I'm assuimg you mean you have a time in GMT such as 1:00am and want to
convert it to GMT+10 where it would be 11AM?

On Thu, 30 Sep 2004 12:19:43 +0300, Phpu <[EMAIL PROTECTED]> wrote:
> Howdy
> 
> Is there a time convertor written in php?
> I mean to convert a specific hour/date in all world countries.
> 



-- 
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: [EMAIL PROTECTED]
Mob: +61 0407 057 580

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] World time convertor

2004-09-30 Thread Daniel Spain
Well, I believe you can take a timestamp and use the date() function
to display it in a different timezone. I dont know the specifics as
it's been a while since I last did it.


On Thu, 30 Sep 2004 14:36:21 +0300, Phpu <[EMAIL PROTECTED]> wrote:
> Yes, in this way i want to convert but i have some diffilcuties.
> 
> For example, in USA I have different time.
> 
> 
> 
> - Original Message -
> From: "Daniel Spain" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Thursday, September 30, 2004 2:08 PM
> Subject: Re: [PHP] World time convertor
> 
> > I'm assuimg you mean you have a time in GMT such as 1:00am and want to
> > convert it to GMT+10 where it would be 11AM?
> >
> > On Thu, 30 Sep 2004 12:19:43 +0300, Phpu <[EMAIL PROTECTED]> wrote:
> > > Howdy
> > >
> > > Is there a time convertor written in php?
> > > I mean to convert a specific hour/date in all world countries.
> > >
> >
> >
> >
> > --
> > Fare thee well,
> > Daniel "TheHeadSage" Spain
> > *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
> > E-mail: [EMAIL PROTECTED]
> > Mob: +61 0407 057 580
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 



-- 
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: [EMAIL PROTECTED]
Mob: +61 0407 057 580

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] str_ireplace problems.

2005-11-01 Thread Daniel Spain
Greetings!

I'm writing a quick and dirty tool which converts directory paths into
internet friendly paths..

So converting this: C:\PHP
to this: file:\\server01\share\PHP

Everything else works, except this line of code.. Is there some
problem I'm overlooking? My PHP skills are limited to database
manipulation, so string functions other than nl2br are beyond me...

The code I'm using is:

//Remove the drive letter and replace it with a single slash
$step1 = str_ireplace("T:\\", "\\", $_POST['path']);

In context:
//Remove the drive letter and replace it with a single slash
$step1 = str_ireplace("T:\\", "\\", $_POST['path']);
$step2 = "file:server01\\staffpub".$step1;
$html = "Staff";
$result = htmlspecialchars($html);

--
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: [EMAIL PROTECTED]
Mob: +61 0407 057 580

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: str_ireplace problems. [Solved]

2005-11-01 Thread Daniel Spain
I've solved the problem. Turns out it wasn't my fault, but the other
network admins...

He said he installed PHP 5.. Turns out that in his mind 5 = 4. So I
changed from str_ireplace to str_replace and it all works.

Thanks for the website though!

On 02/11/05, Gustavo Narea <[EMAIL PROTECTED]> wrote:
> Daniel Spain wrote:
> > //Remove the drive letter and replace it with a single slash
> > $step1 = str_ireplace("T:\\", "\\", $_POST['path']);
>
> I would use:
> $step1 = ereg_replace(trim("^[:alpha:]"),"",$_POST['path']);
>
> This will remove the first letter of the string. You should use this,
> unless this letter is "T" forever. As far as I can see, this is for
> Windows, and the letter may change depending on the machine.
>
> On the other hand, you should verify that the user is sending you a
> right path.
>
> The instruction I suggested you is based on Regular Expressions. If you
> want to get more information about them, I suggest you:
> http://www.regular-expressions.info
>
> PS: If get_magic_quotes_gpc() returns true, you should use
> stripslashes() too:
> $step1 = ereg_replace(trim("^[:alpha:]"),"", stripslashes($_POST['path']));
>
> --
> Best regards,
>
> Gustavo Narea.
> PHP Documentation - Spanish Translation Team.
> Valencia, Venezuela.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: [EMAIL PROTECTED]
Mob: +61 0407 057 580

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php