php-windows Digest 6 Nov 2003 20:58:35 -0000 Issue 1987

Topics (messages 22012 through 22024):

Re: Two Dimm. Arrays
        22012 by: Svensson, B.A.T. (HKG)

Re: using result of function in same line
        22013 by: Svensson, B.A.T. (HKG)
        22020 by: Stoner, David M.

PDFlib text format
        22014 by: Disko_kex

String Help
        22015 by: Herhuth, Ron
        22016 by: Ignatius Reilly
        22017 by: Svensson, B.A.T. (HKG)
        22018 by: Herhuth, Ron

talking to flash
        22019 by: Bobo Wieland
        22021 by: Luis Ferro
        22022 by: Vail, Warren
        22023 by: Vail, Warren
        22024 by: Frank M. Kromann

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 ---
What's your problem?

Creating a FOR-loop or assigning/retriving the values?

-----Original Message-----
From: Muhammad Imran
To: [EMAIL PROTECTED]
Sent: 11/6/2003 3:35 AM
Subject: [PHP-WIN] Two Dimm. Arrays

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);
> }
>
>
>

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

--- End Message ---
--- Begin Message ---
 
It is called "bad programming habbits".

-----Original Message-----
From: Igor Belagorudsky
To: [EMAIL PROTECTED]
Sent: 11/6/2003 2:26 AM
Subject: [PHP-WIN] using result of function in same line

[...]

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

--- End Message ---
--- Begin Message ---
I've never seen a language where you couldn't do things like "echo foo() ;"
and I've seen a good many languages.  It's so universal, I don't know that
it has a name, other than "expression evaluation".   Language processors
typically evaluate inner subexpressions first, then use the value in
evaluating the containing expression.  

That said, I'm still pretty new to PHP, so as far as I know PHP may be
deficient in that capability.


-----Original Message-----
From: Igor Belagorudsky [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 7:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] using result of function in same line


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?

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





--- End Message ---
--- Begin Message ---
Hi,
 
If I have a squre 100px width and 100px height and a textstring = "hello
hello hello hello hello hello hello hello hello hello", is it possible
to write the text into that area. I tried a few comands but didn't
succeed.
 
/ jocke

--- End Message ---
--- Begin Message ---
I have an instance where I am trying to remove a couple different string
scenerios from a variable.  I have spent some time with regEx but I'm not
getting anywhere.  I'm hoping someone could help me out here.

Basically I have names that MAY contain middle initials which I need to
remove:

John D. Smith

I need to strip the "D." so that I have only John Smith

In addition I have a few instances where the name contains a secondary
last name in parentheses that I need to remove:

Joanne (Taylor) Smith

I need to strip the Taylor so that I am left with Joanne Smith.

If anybody could help me with this I would be very appreciative.

Ron



--- End Message ---
--- Begin Message ---
This seems to work:

$pattern = "/(\w+) (?:(?:\w\.|\(\w+\))) (\w+)/" ;
$replacement = "\$1 \$2" ;

//$string = "John D. Smith" ;
$string = "Joanne (Taylor) Smith" ;

echo preg_replace( $pattern, $replacement, $string ) ; 

HTH
Ignatius
_________________________
----- Original Message ----- 
From: "Herhuth, Ron" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 06, 2003 2:54 PM
Subject: [PHP-WIN] String Help



I have an instance where I am trying to remove a couple different string
scenerios from a variable.  I have spent some time with regEx but I'm not
getting anywhere.  I'm hoping someone could help me out here.

Basically I have names that MAY contain middle initials which I need to
remove:

John D. Smith

I need to strip the "D." so that I have only John Smith

In addition I have a few instances where the name contains a secondary
last name in parentheses that I need to remove:

Joanne (Taylor) Smith

I need to strip the Taylor so that I am left with Joanne Smith.

If anybody could help me with this I would be very appreciative.

Ron



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

--- End Message ---
--- Begin Message ---
Do you have control on the input data? E.g. are or are not
the input originated from the entropy source known as end
users?

-----Original Message-----
From: Herhuth, Ron
To: [EMAIL PROTECTED]
Sent: 2003-11-06 14:54
Subject: [PHP-WIN] String Help


I have an instance where I am trying to remove a couple different string
scenerios from a variable.  I have spent some time with regEx but I'm
not
getting anywhere.  I'm hoping someone could help me out here.

Basically I have names that MAY contain middle initials which I need to
remove:

John D. Smith

I need to strip the "D." so that I have only John Smith

In addition I have a few instances where the name contains a secondary
last name in parentheses that I need to remove:

Joanne (Taylor) Smith

I need to strip the Taylor so that I am left with Joanne Smith.

If anybody could help me with this I would be very appreciative.

Ron



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

--- End Message ---
--- Begin Message ---
Thank You!

I appreciate all of the quick replies...you guys rock!

Ron


>From: Ignatius Reilly
>To: Herhuth, Ron; [EMAIL PROTECTED]
>Sent: 11/06/2003 9:21 AM
>This seems to work:
>
>$pattern = "/(\w+) (?:(?:\w\.|\(\w+\))) (\w+)/" ;
>$replacement = "\$1 \$2" ;
>
>//$string = "John D. Smith" ;
>$string = "Joanne (Taylor) Smith" ;
>
>echo preg_replace( $pattern, $replacement, $string ) ;
>
>HTH
>Ignatius
>_________________________
>----- Original Message -----
>From: "Herhuth, Ron" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, November 06, 2003 2:54 PM
>Subject: [PHP-WIN] String Help
>
>
>
>I have an instance where I am trying to remove a couple different string
>scenerios from a variable.  I have spent some time with regEx but I'm not
>getting anywhere.  I'm hoping someone could help me out here.
>
>Basically I have names that MAY contain middle initials which I need to
>remove:
>
>John D. Smith
>
>I need to strip the "D." so that I have only John Smith
>
>In addition I have a few instances where the name contains a secondary
>last name in parentheses that I need to remove:
>
>Joanne (Taylor) Smith
>
>I need to strip the Taylor so that I am left with Joanne Smith.
>
>If anybody could help me with this I would be very appreciative.
>
>Ron
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

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

How do I set up a php-script so that it can communicate with Flash MX?

I send a querystring to the php-script - but I don't know how to return
anything from that function or how to check if it works...

Anyone? I guess it would be the same principles as to communicate with some
other program, so if you know how to communicate with something other then
Flash that would be great too...

thanks!

.bobo

--- End Message ---
--- Begin Message --- Well, not really...

The best bet would be to investigate the flash activescript capabilities... there are examples of it interacting with php all over the web... (i would use some sort of xml to do it, due to its flexibility in both flash and php)...

Cheers,
Luis Ferro

Bobo Wieland wrote:

Hi!

How do I set up a php-script so that it can communicate with Flash MX?

I send a querystring to the php-script - but I don't know how to return
anything from that function or how to check if it works...

Anyone? I guess it would be the same principles as to communicate with some
other program, so if you know how to communicate with something other then
Flash that would be great too...

thanks!

.bobo




--- End Message ---
--- Begin Message ---
Ming has the capability of producing flash movie files on the fly from php,
in much the same fashion as GD produces images on the fly.  Here are a
couple of sources of information;

http://www.php.net/manual/en/ref.ming.php
http://ming.sourceforge.net/ming/

Good Luck,

Warren Vail


-----Original Message-----
From: Bobo Wieland [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 8:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] talking to flash


Hi!

How do I set up a php-script so that it can communicate with Flash MX?

I send a querystring to the php-script - but I don't know how to return
anything from that function or how to check if it works...

Anyone? I guess it would be the same principles as to communicate with some
other program, so if you know how to communicate with something other then
Flash that would be great too...

thanks!

.bobo

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

--- End Message ---
--- Begin Message ---
Oops, that second url should be;

http://ming.sourceforge.net/
and here is another;

http://www.opaque.net/

again good luck,

Warren

-----Original Message-----
From: Vail, Warren 
Sent: Thursday, November 06, 2003 10:07 AM
To: 'Bobo Wieland'; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] talking to flash


Ming has the capability of producing flash movie files on the fly from php,
in much the same fashion as GD produces images on the fly.  Here are a
couple of sources of information;

http://www.php.net/manual/en/ref.ming.php
http://ming.sourceforge.net/ming/

Good Luck,

Warren Vail


-----Original Message-----
From: Bobo Wieland [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 8:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] talking to flash


Hi!

How do I set up a php-script so that it can communicate with Flash MX?

I send a querystring to the php-script - but I don't know how to return
anything from that function or how to check if it works...

Anyone? I guess it would be the same principles as to communicate with some
other program, so if you know how to communicate with something other then
Flash that would be great too...

thanks!

.bobo

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

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

--- End Message ---
--- Begin Message ---
I keep working version of the ming extension for win32 on my website at
http://kromann.info/php4.php or http://kromann.info/php5.php.

These versions are build with the cvs version of ming (0.3a).

- Frank

> Oops, that second url should be;
> 
> http://ming.sourceforge.net/
> and here is another;
> 
> http://www.opaque.net/
> 
> again good luck,
> 
> Warren
> 
> -----Original Message-----
> From: Vail, Warren 
> Sent: Thursday, November 06, 2003 10:07 AM
> To: 'Bobo Wieland'; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] talking to flash
> 
> 
> Ming has the capability of producing flash movie files on the fly from
php,
> in much the same fashion as GD produces images on the fly.  Here are a
> couple of sources of information;
> 
> http://www.php.net/manual/en/ref.ming.php
> http://ming.sourceforge.net/ming/
> 
> Good Luck,
> 
> Warren Vail
> 
> 
> -----Original Message-----
> From: Bobo Wieland [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 06, 2003 8:50 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] talking to flash
> 
> 
> Hi!
> 
> How do I set up a php-script so that it can communicate with Flash MX?
> 
> I send a querystring to the php-script - but I don't know how to return
> anything from that function or how to check if it works...
> 
> Anyone? I guess it would be the same principles as to communicate with
some
> other program, so if you know how to communicate with something other
then
> Flash that would be great too...
> 
> thanks!
> 
> .bobo
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---

Reply via email to