php-windows Digest 6 Nov 2003 06:30:52 -0000 Issue 1986

Topics (messages 22007 through 22011):

Changing the format of a date
        22007 by: Herhuth, Ron
        22008 by: Ignatius Reilly

using result of function in same line
        22009 by: Igor Belagorudsky

Two Dimm. Arrays
        22010 by: Muhammad Imran

BLOB, LONVARCHAR FROM DB2
        22011 by: Walter Gyr

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I have a current date in the format:
Jun 15 1956

I need to convert it to:
06/15/1956

Is there a quick way to do this in PHP?

Ron



--- End Message ---
--- Begin Message ---
$months = array( "Jan" => "01", ... ) ;
$str = "Jun 15 1956" ;
$str = explode( " ", $str ) ;
$str = $months[$str[0]] ."/".$str[1] ."/". $str[2] ;

HTH
Ignatius
_________________________
----- Original Message ----- 
From: "Herhuth, Ron" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 9:09 PM
Subject: [PHP-WIN] Changing the format of a date



I have a current date in the format:
Jun 15 1956

I need to convert it to:
06/15/1956

Is there a quick way to do this in PHP?

Ron



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

--- End Message ---
--- Begin Message ---
ok here's the problem - in some languages (like javascript or c# for
instance) you could use the results of a function in same line as your call.
say you have a function foo that returns an array, you can do something like

print foo()[4];

this will print the 5th element of whatever array foo returned.
but in php, it seems like you have to break it up into 2 calls like this:

$x = foo();
echo $x[4];

i find it hard to believe that you can't do

echo foo()[4];

so... how can u go about this?

thanks,
igor

and also, what is that called when you can do it in same line?

--- End Message ---
--- Begin Message ---
How I can populate and restore the two dimensional array dynamically i.e
under for/while loop. This is used in pear db but not directly link to just
pear. Below is the code in which array is build manually.

array(  array(1, 'one', 'en'),
                    array(2, 'two', 'to'),
                    array(3, 'three', 'tre'),
                    array(4, 'four', 'fire'));

Thank you,
Imran

> From: "Muhammad Imran" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 05, 2003 1:24 PM
> Subject: [PHP-WIN] Pear ::DB
>
>
> I am using Pear::DB package, Can anybody help me if I have array of values
> and I want to prepare the insert statements through those arrays.
>
> Below is the example which I find on every site but not found what I need,
> please help me.
>
> Thank you,
> Imran
>
>   $alldata = array(  array(1, 'one', 'en'),
>                    array(2, 'two', 'to'),
>                    array(3, 'three', 'tre'),
>                    array(4, 'four', 'fire'));
> $sth = $dbh->prepare("INSERT INTO numbers VALUES(?,?,?)");
>
> $dbh->executeMultiple($sth, $alldata);
> }
>
>
>

--- End Message ---
--- Begin Message --- Hi

I cannot select or update blob or longvarchar columns on a
ibm db2 DB. I use odbc on php 4.3.0 and win2000.

By a select the data are not complete (only first bytes)

Has anybody a solution for this problem ?


walter

--- End Message ---

Reply via email to