[PHP] Re: creating objects by reference?

2002-12-18 Thread Matthew Gray
Jonathan Sharp wrote: > Is it better to do: > $obj = &new object(); > > verses: > $obj = new object(); > > thanks, > -js If you are looking to the future: I don't believe the ability to return objects by reference will be an option in Zend Engine 2. Matt -- PHP General Mailing List (http:/

[PHP] Re: is there php equiv left() and right() functions?

2002-12-18 Thread Matthew Gray
Jeff Bluemel wrote: > I have a string that will look like the following; > > data1|data2 > > now - I need to put data1 in a variable, and data2 in another variable. > I've found the functions strlen, and strpos, but I can't figure how to > grab this data. > > thanks, > > Jeff Try list($var1,

[PHP] Re: Convert a grayscale value to a #RRGGBB hex value

2002-06-24 Thread Matthew Gray
If you know its grayscale... function GrayScaleToHex( $val ) { $norm = $val * 2.55 + $val/100; $hex = sprintf("%02X", $norm); return '#' . $hex . $hex . $hex; } Should get you close enough. Matt René fournier wrote: > Anyone know how I might convert a grayscale value, from betwe

[PHP] Re: Classes Constructor syntax

2002-07-17 Thread Matthew Gray
PHP does not support multiple constructors. But, It does support variable argument lists, so you can fake it with func_get_args() and func_get_num_args(): function issue() { if( func_get_num_args() > 0 ) { $args = func_get_args() } else { // do something else...

[PHP] Re: Image functions

2002-04-19 Thread Matthew Gray
You won't get very far if you aren't outputting an image to the browser using ImageJpeg(), etc. Matt Matthew J Gray UWRF - Information Technology Services [EMAIL PROTECTED] Gerard Samuel wrote: > Im trying to modify a poll script to not use the hard coded image files > and use php's image func