Re: [PHP] ImageMagick

2009-04-30 Thread Ashley Sheridan
On Thu, 2009-04-30 at 23:35 -0700, Michael A. Peters wrote: > Here's the scenario - > > Website has some demonstrative images. > > I create these images with the gimp - starting with a jpeg, adding a few > text layers and straight lines. > > I then save as xcf in case I ever need to edit. > >

[PHP] ImageMagick

2009-04-30 Thread Michael A. Peters
Here's the scenario - Website has some demonstrative images. I create these images with the gimp - starting with a jpeg, adding a few text layers and straight lines. I then save as xcf in case I ever need to edit. Then I export to jpeg, resize for thumb and export to jpeg again. Admin inter

Re: [PHP] Two very useful PHP functions

2009-04-30 Thread Raymond Irving
Hi Colin and Daniel, Thanks for the feedback. I know that this functionality can be added to a framework or a stand alone function but I'm assuming that we would not get the same performance: Case 1 --- $c = isset($a) ? $a : ''; // total time = overhead of isset() + overhead of ?: C

Re: [PHP] DateInterval

2009-04-30 Thread MIke Alaimo
Ah. This makes perfect sense. Good idea. Mike Raymond Irving wrote: --- On Wed, 4/29/09, MIke Alaimo wrote: Raymond, have you tried using DateTime::modify? It appears to work like strtotime. also DateTime::format works like date. At least as far as I can tell. From the little

[PHP] Eclipse, PDT plugins for hosting, scaling and managing PHP apps.

2009-04-30 Thread Kevin Hakman
re: Eclipse, PDT plugins for hosting, scaling and managing PHP apps. Aptana has released a new suite of tools for PHP developers that extends the popular Eclipse PDT environment. The plugin for Eclipse, called Aptana Cloud Connect, lets you get all the benefits of scalable, on-demand PHP hostin

Re: [PHP] utf-8 ?

2009-04-30 Thread Chris
The consensus seems to be that the proposed "ifset()" and "ifempty()" functions are more effort than they are worth. What I'd like to know is, why "empty()" still exists when every time I turn around, the mentors I turn to locally tell me not to use it, to use "isset()" instead. Because empty()

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/30/09 6:15 PM, "Reese" wrote: > Tom Worster wrote: > >> why use SGML character entity references in a utf-8 file or stream? can't >> you just put the character in the file? > > Because, I thought, HTML files were basically just text files with > different file extensions, and that those ot

[PHP] Bhups on the go for a Charity Walk! - Any support appreciated.

2009-04-30 Thread memberservi...@justgiving.com
Hello! I'm taking part in the ISSO Seva Charity Walk 2009 on 19/07/2009 to raise money for International Swaminarayan Satsang Organisation and I'd really appreciate your support. It's easy to sponsor me online by credit or debit card - just go to my Justgiving page: http://www.justgiving.co

Re: [PHP] utf-8 ?

2009-04-30 Thread Andrew Hucks
It'd be a hassle to just remove a function from a language, I suppose... On Thu, Apr 30, 2009 at 6:15 PM, Reese wrote: > Tom Worster wrote: > >> why use SGML character entity references in a utf-8 file or stream? can't >> you just put the character in the file? > > Because, I thought, HTML files

Re: [PHP] utf-8 ?

2009-04-30 Thread Reese
Tom Worster wrote: why use SGML character entity references in a utf-8 file or stream? can't you just put the character in the file? Because, I thought, HTML files were basically just text files with different file extensions, and that those other characters would not store or display properly

[PHP] object literals

2009-04-30 Thread Tom Worster
is there a neat literal syntax for creating objects on the fly without defining a type? whenever i need to do it i do something like $x = (object) array('a'=>1, 'b'=>3, ...); which works but isn't very lovely. it's neater in, for example, javascript. -- PHP General Mailing List (http://w

Re: [PHP] php forms - select menu selected behavior

2009-04-30 Thread Ashley Sheridan
On Thu, 2009-04-30 at 11:06 +0200, Marcus Gnaß wrote: > Troy Oltmanns wrote: > > I have the code below being used to rifle through a list of available > > categories and create select options for them. The code is being used to > > query the database and compare the product category to the current

[PHP] $this = new Class();

2009-04-30 Thread Olivier Lalonde
Hi all, Since I can't do $this = new Class(); within my class (it gives an error), I was looking for ways to get the same result by other means. I am actually working on an ORM and trying to implement lazy loading. $book = $orm->getBook('id'); // returns an Orm object $book->load(); // $book sh

Re: [PHP] Two very useful PHP functions

2009-04-30 Thread Daniel Brown
On Wed, Apr 29, 2009 at 22:32, Raymond Irving wrote: > > What do you think? Can they make it into 5.3? Not when doing the ternary operator that you even displayed yourself takes up less code and time than a core function would. It's a good idea, but better handled on the frontend of things.

[PHP] Re: Static and/or Dynamic site scraping using PHP

2009-04-30 Thread Shawn McKenzie
9el wrote: > On Thu, Apr 30, 2009 at 3:33 AM, 9el wrote: >> I just got a project to do on PHP of scraping the body items from >> static sites or just html sites. >> Could you experts please suggest me some quick resources? >> >> I have to make an WP plugin with the data as well. > > Any expert th

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/29/09 6:52 PM, "Reese" wrote: > Tom Worster wrote: >> On 4/28/09 4:05 PM, "Reese" wrote: >> >>> Granted, this isn't a PHP question but I'm curious, how does UTF-8 solve >>> this display issue? >> >> if we're talking about web browsers, they are quite good at automatically >> choosing font

Re: [PHP] Warning: Division by zero

2009-04-30 Thread Christoph Boget
> The error I am getting is when I am defining a variable. > (line 15) $percent_difference=($assess_difference)/($assess_value); > Does this make a difference? No, it doesn't make a difference. The simple fact is that $assess_value is either undefined or has been set to 0 at some point. For it's

Re: [PHP] Warning: Division by zero

2009-04-30 Thread Gary
Thanks for your response. The error I am getting is when I am defining a variable. (line 15) $percent_difference=($assess_difference)/($assess_value); Does this make a difference? Thanks again for all your help. Gary "Christoph Boget" wrote in message news:540509760904300600i7af94667w6bad3

Re: [PHP] Getting Sub Elements with XPath

2009-04-30 Thread Andrew Ballard
On Thu, Apr 30, 2009 at 5:02 AM, AngeloZanetti wrote: > > Hi all, > > I have the following XML returned to us. > > > > > > > ToDay="0" Currency="ZAR" > ChargeAmount="320.00"/> >

[PHP] Re: Static and/or Dynamic site scraping using PHP

2009-04-30 Thread 9el
On Thu, Apr 30, 2009 at 3:33 AM, 9el wrote: > I just got a project to do on PHP of scraping the body items from > static sites or just html sites. > Could you experts please suggest me some quick resources? > > I have to make an WP plugin with the data as well. Any expert there yet? Was looking f

Re: [PHP] Warning: Division by zero

2009-04-30 Thread Christoph Boget
> I have a script that is a result of data entered in a form > On the script (when I test without data entry), I am getting a warning that > Warning: Division by zero in .inc.php on line 15. > The warning is correct, however the viewer cannot access the second script > without entering the data tha

RE: [PHP] Warning: Division by zero

2009-04-30 Thread kyle.smith
It's always better to validate your inputs in any was possible, this helps prevent exploits. -Original Message- From: Gary [mailto:gwp...@ptd.net] Sent: Thursday, April 30, 2009 8:51 AM To: php-general@lists.php.net Subject: [PHP] Warning: Division by zero I have a script that is a resu

[PHP] Warning: Division by zero

2009-04-30 Thread Gary
I have a script that is a result of data entered in a form On the script (when I test without data entry), I am getting a warning that Warning: Division by zero in .inc.php on line 15. The warning is correct, however the viewer cannot access the second script without entering the data that woul

[PHP] Getting Sub Elements with XPath

2009-04-30 Thread AngeloZanetti
Hi all, I have the following XML returned to us.

Re: [PHP] php forms - select menu selected behavior

2009-04-30 Thread Marcus Gnaß
Troy Oltmanns wrote: > I have the code below being used to rifle through a list of available > categories and create select options for them. The code is being used to > query the database and compare the product category to the current > iteration, if there's a match, then add selected code so the

Re: [PHP] Boolean Parameter to 3 Options?

2009-04-30 Thread Richard Quadling
2009/4/29 Matt Neimeyer : > On Wed, Apr 29, 2009 at 1:30 PM, Shawn McKenzie wrote: >> Philip Thompson wrote: >>> On Apr 29, 2009, at 11:42 AM, Matt Neimeyer wrote: >>> I have a function that currently takes a boolean value as a parameter. But now I want to expand it to 3 options...  So

[PHP] Renaming archive entries doesnt work

2009-04-30 Thread Darren Karstens
Hi, I am trying to add a prefix to all of the entries in a zip file using the ZipArchive::renameIndex function which is corrupting the files when I try to extract them. I was wondering if anyone else has used this method successfully? Here is the code im using: $client='TEST'; $zip = new ZipArchiv

[PHP] Re: Two very useful PHP functions

2009-04-30 Thread Colin Guthrie
'Twas brillig, and Raymond Irving at 30/04/09 03:32 did gyre and gimble: Hello, Every so often I have to be using the isset() function to check if a variable exists. It would be useful to have something like an ifset() function Instead of doing this $v = isset($input) ? $input : $default; we