Re: [PHP] Variable functions within an object

2004-07-30 Thread Julio Sergio Santana
Curt Zirzow wrote: $this-{$this-fname}(); or (what it actually is doing.. ) $func = $this-fname; $this-$func(); Curt The point here is that the named function is outside the object. That is, $this-foo() doesn't exist, so $this-{$this-fname}(), does not work either. But if you look at

Re: [PHP] Variable functions within an object

2004-07-30 Thread Julio Sergio Santana
Curt Zirzow wrote: or for the oneline purists :) ${ ${$this-fname} = $this-fname }(); wow.. ${} is more powerful than i had originally though. Thank you Curt, With your suggestion, I finally re-wrote the example, and here it is: ?php function foo() { echo In foo()br /\n; } class a { var

[PHP] Variable functions within an object

2004-07-29 Thread Julio Sergio Santana
I need to record the names of functions, and then use them later. Recently I found the following example within the on-line documentation: ?php function foo() { echo In foo()br /\n; } $func = 'foo'; $func();// This calls foo() ? then I supposed that it was easy to extend this concept to

[PHP] How can I write/read encoded numbers into/from a file?

2004-07-08 Thread Julio Sergio Santana
I'm just starting with PHP, and I've been browsing the whole manual to find how to solve the following problem: 1. An integer number is internally represented in 4 bytes. Say, for instance, number 65 is represented by 0x0041, that is the string \0\0\0\0x41, and not the string 65. 2. How

Re: [PHP] How can I write/read encoded numbers into/from a file?

2004-07-08 Thread Julio Sergio Santana
** It was supposed to output: ***65*** [EMAIL PROTECTED] wrote: http://us4.php.net/manual/en/function.base64-decode.php -Original Message- From: Julio Sergio Santana [EMAIL PROTECTED] Sent: Jul 8, 2004 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] How can I write/read encoded numbers into/from a file

Re: [PHP] How can I write/read encoded numbers into/from a file?

2004-07-08 Thread Julio Sergio Santana
the data into a var $iAnswer = ord($sBuff{0}) | ord($sBuff{1}) 8 | ord($sBuff{2}) 16 | ord($sBuff{3}) 24; // Get the numerical value of each byte, then shift the bytes to get the 4 byte number. (Little Endian) Chris Julio Sergio Santana wrote: I'm just starting with PHP, and I've been