php-general Digest 11 Jan 2006 12:22:18 -0000 Issue 3899

Topics (messages 228445 through 228465):

Re: Floating numbers truncating to two digits without rounding
        228445 by: Anas Mughal

Re: Maps and plotting data
        228446 by: Raj Shekhar

Re: PHP and SOAP newbie questions
        228447 by: Weber Sites LTD

Speed
        228448 by: Peter Lauri
        228452 by: Philip Hallstrom
        228453 by: Weber Sites LTD
        228463 by: Rodolfo Andrade

Case-Insensitive include on linux.
        228449 by: Mathijs
        228450 by: Albert
        228451 by: Marco Kaiser
        228454 by: George Pitcher
        228456 by: Mathijs

Check how much/which variables there are in an class
        228455 by: Mathijs
        228461 by: Stefan Reimers
        228464 by: Mathijs

test variable value?
        228457 by: William Stokes
        228458 by: William Stokes
        228459 by: Jochem Maas
        228460 by: Stut
        228462 by: Rodolfo Andrade

Image size?
        228465 by: William Stokes

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:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Oh, yes, Gerry has provided very useful links.
You could definetly look into using something like:

printf( "%.2f", $x );


--
Anas Mughal





On 1/10/06, Gerry Danen <[EMAIL PROTECTED]> wrote:
>
> sprintf creates a string ready for you to manipulate. So does
> number_format. Pick whatever is best for your purpose.
>
> See http://uk2.php.net/manual/en/function.sprintf.php and
> http://uk2.php.net/manual/en/function.number-format.php for more info.
>
> Gerry
>
>
> On 1/10/06, Mark Steudel <[EMAIL PROTECTED]> wrote:
> > Can I do this all with sprintf or do I then need to convert it to a
> string
> > and chop off what I don't want?
> >
> > -----Original Message-----
> > From: Gerry Danen [mailto:[EMAIL PROTECTED]
> > Sent: Monday, January 09, 2006 3:35 PM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] Floating numbers truncating to two digits without
> > rounding
> >
> > Mark,
> >
> > Why not use sprintf() with an arbitrary large number of decimals and
> then
> > discard all but the 2 you want. I.e., format with 10 decimals and then
> drop
> > the last 8.
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Anas Mughal

--- End Message ---
--- Begin Message ---
Adrian Bruce <[EMAIL PROTECTED]> writes:

> Has anyone used any of the php mapping classes that are available?
> (Image_GIS etc) I would like to create dynamic maps and plot data
> i.e. postcodes on them like you do in applications like map-point.  I
> am not quite sure if  there is any php scripts/programs that already
> do this or if i have to do this myself. I can see it being very time
> consuming to geo-map a map image and match up all co-ordinates with
> postal code values!
> 
> Any suggestions/experiences would be most appreciated.

You might want to check out
http://toys.lerdorf.com/archives/36-More-fun-with-the-Yahoo!-Maps-API.html . 

-- 
Raj Shekhar
blog : http://rajshekhar.net/blog  home : http://rajshekhar.net
Disclaimer : http://rajshekhar.net/disclaimer

--- End Message ---
--- Begin Message ---
I'm not experienced with WSDL but I can see it's in use here : 

http://www.weberdev.com/ViewArticle/439


Maybe it can help...

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP Web Logs : http://www.weberblog.com/ 
PHP & MySQL Forums : http://www.weberforums.com/ 
Learn PHP Playing Trivia http://www.webertrivia.com 
Web Development Index http://www.weberindex.com 
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com 

 

-----Original Message-----
From: Jay Paulson (CE CEN) [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 10, 2006 12:27 AM
To: php-general@lists.php.net
Subject: [PHP] PHP and SOAP newbie questions

I recently got handed a project that requires me to use PHP to talk to a
WSDL SOAP service.  I'm not new to PHP but I am new to SOAP.  I have the
basic idea of how SOAP works but still have a few questions I am hoping you
all can answer for me.

Which library would be better to use?  NuSOAP or PEAR's SOAP library?

Someone else is writing the WSDLs that I need to access.  Does this mean
that I just have to use a SOAP client to access the information or would I
need to make a SOAP server?  I guess what I'm asking is what is the
difference between a SOAP client and a SOAP server?

Lastly, do you all know of any good online tutorials I could check out that
google may not suggest?

Thanks!
Jay

--- End Message ---
--- Begin Message ---
Best group member,

 

Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?

 

/Peter


--- End Message ---
--- Begin Message ---
Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?

MySQL.

You don't have to transfer all 10,000 records to PHP for one thing.

-philip

--- End Message ---
--- Begin Message ---
Why not check it?

Try to query for the AVG() and get the result or query for the data
and do a loop in PHP to calculate the AVG. Check the time each 
Takes.

My Money is that getting the value from SQL will be faster.

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP Web Logs : http://www.weberblog.com/ 
PHP & MySQL Forums : http://www.weberforums.com/ 
Learn PHP Playing Trivia http://www.webertrivia.com 
Web Development Index http://www.weberindex.com 
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com 


-----Original Message-----
From: Peter Lauri [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 11, 2006 9:14 AM
To: php-general@lists.php.net
Subject: [PHP] Speed

Best group member,

 

Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?

 

/Peter

--- End Message ---
--- Begin Message ---
I think calculating directly in MySQL will be faster, since less data will
be "travelling" from MySQL to PHP.

Just my 2ยข.

Regards,
Rodolfo Andrade

----- Original Message ----- 
From: Weber Sites LTD
To: 'Peter Lauri' ; php-general@lists.php.net
Sent: Wednesday, January 11, 2006 6:07 AM
Subject: RE: [PHP] Speed


Why not check it?

Try to query for the AVG() and get the result or query for the data
and do a loop in PHP to calculate the AVG. Check the time each
Takes.

My Money is that getting the value from SQL will be faster.

Sincerely

berber

Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
PHP Web Logs : http://www.weberblog.com/
PHP & MySQL Forums : http://www.weberforums.com/
Learn PHP Playing Trivia http://www.webertrivia.com
Web Development Index http://www.weberindex.com
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-----Original Message-----
From: Peter Lauri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 11, 2006 9:14 AM
To: php-general@lists.php.net
Subject: [PHP] Speed

Best group member,



Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?



/Peter

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

--- End Message ---
--- Begin Message ---
Hello there,

Is there a way to have include() be case-insensitive?
This would be very handy.

Thx in advanced.

--- End Message ---
--- Begin Message ---
Mathijs wrote:
> Is there a way to have include() be case-insensitive?
Linux file systems are case sensitive. The include() and require() functions
try to open the file specified. If you enter the wrong case the file system
will return that the file does not exist.

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.17/226 - Release Date: 2006/01/10
 

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

this is very stupid because you can have files in a directory named:

PleaSeINCLUDeMe.php
pleaseincludeme.php

and if you do a case insensitive include which one should be included?
The include stuff works insensitive under windows great because the
filesystem does not permit 2 file with the same name in a directory.
The example above is not possible.

-- Marco

2006/1/11, Albert <[EMAIL PROTECTED]>:
>
> Mathijs wrote:
> > Is there a way to have include() be case-insensitive?
> Linux file systems are case sensitive. The include() and require()
> functions
> try to open the file specified. If you enter the wrong case the file
> system
> will return that the file does not exist.
>
> Albert
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.17/226 - Release Date:
> 2006/01/10
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Marco Kaiser

--- End Message ---
--- Begin Message ---
Mathijs wrote:

> Is there a way to have include() be case-insensitive?

If you are know that all your file and directory names are lower case, but
users may input mixed case responses that will be used to determine the
include, you can set the case of the user input to lower case with
strtolower(). Or strtoupper() - the choice is yours.

If you have been a bit careless in naming your directories or filenames,
then I'd do some site maintenance and get that sorted first.

George

--- End Message ---
--- Begin Message ---
George Pitcher wrote:
Mathijs wrote:

Is there a way to have include() be case-insensitive?

If you are know that all your file and directory names are lower case, but
users may input mixed case responses that will be used to determine the
include, you can set the case of the user input to lower case with
strtolower(). Or strtoupper() - the choice is yours.

If you have been a bit careless in naming your directories or filenames,
then I'd do some site maintenance and get that sorted first.

George

Owkay, its clear :).
I just wondered if it was possible, would save some other trouble :).

Thx for the help.

--- End Message ---
--- Begin Message ---
Is there a way to check how much/which variables there are in an class?

Thx in advanced.

--- End Message ---
--- Begin Message ---
Try

array get_class_vars ( string class_name)

This will return an array with at least the public variables.


Mathijs wrote:
Is there a way to check how much/which variables there are in an class?

Thx in advanced.

--- End Message ---
--- Begin Message ---
Stefan Reimers wrote:
Try

array get_class_vars ( string class_name)

This will return an array with at least the public variables.


Mathijs wrote:
Is there a way to check how much/which variables there are in an class?

Thx in advanced.

It works, but only for the public indeed.
Is there also a way to get the private/protected variables?

--- End Message ---
--- Begin Message ---
Hello

What is the best way to determine if a variable has no value?

if ($var= '')

or

if ($var= 'null')


Can 'null' be used here?

Thanks
-Willa 

--- End Message ---
--- Begin Message ---
Hello

What is the best way to determine if a variable has no value?

if ($var== '')

or

if ($var== 'null')


Can 'null' be used here?

Thanks
-Willa

--- End Message ---
--- Begin Message ---
William Stokes wrote:
Hello

What is the best way to determine if a variable has no value?

if ($var== '')

or

if ($var== 'null')


Can 'null' be used here?

yeah buts its a string which doesn't do what you want.



if (empty($var)) { echo 'yes'; }

or:

if (is_null($var)) { echo 'yes'; }



Thanks
-Willa


--- End Message ---
--- Begin Message ---
William Stokes wrote:

Hello

What is the best way to determine if a variable has no value?

if ($var== '')

or

if ($var== 'null')


Can 'null' be used here?
Depends what you mean by no value. I suggest you read http://php.net/is_null, http://php.net/empty and http://php.net/isset.

-Stut

--- End Message ---
--- Begin Message ---
How about...

if (!$x){
    echo "x is empty";
}

Regards,
Rodolfo Andradee


----- Original Message ----- 
From: Stut 
To: William Stokes 
Cc: php-general@lists.php.net 
Sent: Wednesday, January 11, 2006 8:08 AM
Subject: Re: [PHP] test variable value?


William Stokes wrote:

>Hello
>
>What is the best way to determine if a variable has no value?
>
>if ($var== '')
>
>or
>
>if ($var== 'null')
>
>
>Can 'null' be used here?
>  
>
Depends what you mean by no value. I suggest you read 
http://php.net/is_null, http://php.net/empty and http://php.net/isset.

-Stut

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

--- End Message ---
--- Begin Message ---
Hello,

Can I get pixel sizes from a uploaded web applicable image with PHP? I mean 
width and height as pixels. If  so How?

Thanks
-Will 

--- End Message ---

Reply via email to