[PHP] strange behavior, when converting float to int

2008-05-06 Thread Maxim Antonov
Hi, all! Is this a bug? [EMAIL PROTECTED]:~$ /usr/bin/php 1.php 45 45 float(46) [EMAIL PROTECTED]:~$ /usr/bin/php -v PHP 5.3.0-dev (cli) (built: Apr 4 2008 11:37:33) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies [EMAIL PROTECTED]:~$ cat

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Aschwin Wesselius wrote: Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch

[PHP] Difference between imagegif/imagejpeg sending to browser - saving to file?

2008-05-06 Thread zyro
Hello together, I stumbled onto a curious problem: i am generating a jpeg/gif with the imagejpeg/imagegif functions (type does not alter the result). Example color #ff: The hexToRGB coversion etc is all working fine. The image (if its send directly to the browser via header and

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Aschwin Wesselius wrote: Aschwin Wesselius wrote: Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have

[PHP] Handling Incoming Email Attachments

2008-05-06 Thread Nirmal Jayasinghe
hello all, I'm trying to figure out a way to manipulate incoming email attachments with PHP. There'll be a special email address to which the emails with the attachments would be sent, with a number specified in the subject line. What I need to do is to grab the attachment (a photo), rename it

Re: [PHP] Handling Incoming Email Attachments

2008-05-06 Thread Aschwin Wesselius
Nirmal Jayasinghe wrote: hello all, I'm trying to figure out a way to manipulate incoming email attachments with PHP. There'll be a special email address to which the emails with the attachments would be sent, with a number specified in the subject line. What I need to do is to grab the

[PHP] getting iostat -x %b with php

2008-05-06 Thread Iv Ray
What is the best way to extract just the drive load information (%b column) from iostat -x (on FreeBSD)? I imagine to exec() the iostat -x and then process the result with regex, but I am not sure if this is the best way - for instance, is %b is aways the Nth column in the returned value?

Re: [PHP] Handling Incoming Email Attachments

2008-05-06 Thread Richard Heyes
For handling e-mail in all their sorts (believe me, it is hell), I found the PECL mailparse the best solution. It can find the attachments and their MIME-types in a snap. And all the headers are separated too. You only have to wrap functions around it to do what you want to do. Be sure to

Re: [PHP] Web page excerpt editor

2008-05-06 Thread tedd
At 9:52 AM -0400 5/5/08, Jason Pruim wrote: On May 5, 2008, at 9:43 AM, tedd wrote: I've been trying to come up with an alternative -- here's my twist: http://www.webbytedd.com/a/easy-page-db Please note the [Edit Mode] link on the top right of the page. I'm not willing to share the code at

Re: [PHP] Web page excerpt editor

2008-05-06 Thread Jason Pruim
On May 6, 2008, at 8:41 AM, tedd wrote: At 9:52 AM -0400 5/5/08, Jason Pruim wrote: On May 5, 2008, at 9:43 AM, tedd wrote: Hey tedd, Just as an idea, would it be alot of work to do a basic editor, and then have an advanced button? That way, for the people who don't know as much they

Re: [PHP] Web page excerpt editor

2008-05-06 Thread tedd
At 11:19 AM -0400 5/5/08, Eric Butera wrote: On Mon, May 5, 2008 at 9:43 AM, tedd [EMAIL PROTECTED] wrote: FCKEditor and TinyMCE are impressive in what they do, but they produce a mix of css and html -- that's not good in my book. This is an interesting idea. Most clients don't want to

Re: [PHP] Web page excerpt editor

2008-05-06 Thread tedd
At 8:49 AM -0400 5/6/08, Jason Pruim wrote: On May 6, 2008, at 8:41 AM, tedd wrote: My only quandary was -- do I allow them to input html or not. I misunderstood what you were going for... But this does give me another idea... Why not give them very simple things like [bold][/bold] and then

Re: [PHP] Where to start!

2008-05-06 Thread tedd
At 1:15 AM -0600 5/5/08, Jorge wrote: First I would like to say that I have had PHP experience but not enough to say I am a PHP developer. I want to use PHP to build a site that uses MySQL, I am building it from scratch so I don't know where to start, should I start with PHP and design a

RE: [PHP] Web page excerpt editor

2008-05-06 Thread Chris Haensel
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 06, 2008 3:02 PM To: php-general@lists.php.net Subject: Re: [PHP] Web page excerpt editor At 8:49 AM -0400 5/6/08, Jason Pruim wrote: On May 6, 2008, at 8:41 AM, tedd wrote: My only quandary was -- do I allow them

[PHP] adding the results of mysql_query

2008-05-06 Thread It Maq
Hi, I need to add the result of 4 calls to mysql_query (4 different queries) to the same object so that i can mysql_fetch_object in the same loop. Is that possible? otherwise is there any other alternative? Thank you

[PHP] Re: adding the results of mysql_query

2008-05-06 Thread M. Sokolewicz
It Maq wrote: Hi, I need to add the result of 4 calls to mysql_query (4 different queries) to the same object so that i can mysql_fetch_object in the same loop. Is that possible? otherwise is there any other alternative? Thank you

Re: [PHP] Where to start!

2008-05-06 Thread Andrew Ballard
On Tue, May 6, 2008 at 9:21 AM, tedd [EMAIL PROTECTED] wrote: At 1:15 AM -0600 5/5/08, Jorge wrote: First I would like to say that I have had PHP experience but not enough to say I am a PHP developer. I want to use PHP to build a site that uses MySQL, I am building it from scratch so I

Re: [PHP] strange behavior, when converting float to int

2008-05-06 Thread Philip Thompson
On May 6, 2008, at 1:38 AM, Maxim Antonov wrote: Hi, all! Is this a bug? [EMAIL PROTECTED]:~$ /usr/bin/php 1.php 45 45 float(46) [EMAIL PROTECTED]:~$ /usr/bin/php -v PHP 5.3.0-dev (cli) (built: Apr 4 2008 11:37:33) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.3.0, Copyright (c)

Re: [PHP] strange behavior, when converting float to int

2008-05-06 Thread Paul Scott
On Tue, 2008-05-06 at 09:34 -0500, Philip Thompson wrote: I got the same results. I'm not exactly sure what's happening, but I'd be curious to see if there's anyone else who can shed some light. PHP Version 5.2.4. Is this not coming from the underlying C libs that directly use the FP on

RES: [PHP] strange behavior, when converting float to int

2008-05-06 Thread Thiago Pojda
There is a logical explanation. [...] you need to be aware that the float data type is not always capable of representing numbers in the way you expect it to. And then follows a example: Consider, for example this simple statement: echo (int) ((0.1 + 0.7) * 10); You would

[PHP] PHP Web Apps OpenID

2008-05-06 Thread Joe Harman
Hey Ya'll! I am curious here if any of you are considering or already using OpenID or Windows CardSpace? Does anyone see this being a big deal??? from a users stand point it seems like a big hassle to get started with it and I'm not sure if it would scare people away or not? any thoughts I've

Re: [PHP] adding the results of mysql_query

2008-05-06 Thread Stut
On 6 May 2008, at 15:05, It Maq wrote: I need to add the result of 4 calls to mysql_query (4 different queries) to the same object so that i can mysql_fetch_object in the same loop. Is that possible? otherwise is there any other alternative? No, but you should be able to do it in one

[PHP] GD - JPEG to PNG with transparency and color

2008-05-06 Thread Travis L. Font
Following files: bg.png - Clear Transparent Image 14416fed5d4f78.jpg - Normal Jpeg Image The Code: header('content-type: image/png'); $watermark = imagecreatefromjpeg('14416fed5d4f78.jpg'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark);

[PHP] Incorrect version shown in phpinfo() and phpversion() in 5.2.6

2008-05-06 Thread Scott Lerman
Has anyone else seen incorrect information on a phpinfo() page on the Windows build of 5.2.6? The Apache log shows Apache/2.0.63 (Win32) PHP/5.2.6 configured -- resuming normal operations, but phpinfo() and phpversion() still show 5.2.5. The CLI executable does show the correct version, though.

Re: [PHP] Incorrect version shown in phpinfo() and phpversion() in 5.2.6

2008-05-06 Thread Daniel Brown
On Tue, May 6, 2008 at 11:57 AM, Scott Lerman [EMAIL PROTECTED] wrote: Has anyone else seen incorrect information on a phpinfo() page on the Windows build of 5.2.6? The Apache log shows Apache/2.0.63 (Win32) PHP/5.2.6 configured -- resuming normal operations, but phpinfo() and phpversion()

Re: [PHP] Where to start!

2008-05-06 Thread tedd
At 10:14 AM -0400 5/6/08, Andrew Ballard wrote: On Tue, May 6, 2008 at 9:21 AM, tedd [EMAIL PROTECTED] wrote: I will respectfully (though strongly) disagree here, tedd. If you are building a guest book and all you need is a place to store and retrieve stuff, store it in a file rather than a

Re: [PHP] Where to start!

2008-05-06 Thread Robert Cummings
On Tue, 2008-05-06 at 13:42 -0400, tedd wrote: At 10:14 AM -0400 5/6/08, Andrew Ballard wrote: On Tue, May 6, 2008 at 9:21 AM, tedd [EMAIL PROTECTED] wrote: I will respectfully (though strongly) disagree here, tedd. If you are building a guest book and all you need is a place to store and

Re: [PHP] Incorrect version shown in phpinfo() and phpversion() in 5.2.6

2008-05-06 Thread Scott Lerman
Yup, I restarted Apache several times. The httpd.conf line I have is LoadModule php5_module C:/Program Files/PHP/php-5.2.6-Win32/php5apache2.dll. If nobody else has seen this problem, I'll just assume it's some oddity on my system. I just figured I'd mention it in case others were having the same

Re: [PHP] Regex to catch ps

2008-05-06 Thread Shawn McKenzie
Ryan S wrote: clip To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs and

[PHP] Re: Re[PHP] gex to catch ps

2008-05-06 Thread vester_s
$tag_regex=array( '/\p(\s*)\(.*?)\\/p\ /si' = $1, '/\(\s*)(*.?)class\=(*.?)\(.*?)\\/(*.?)\/si' = $3 ); $paragraphs=preg_replace(array_keys($tag_regex),array_values($tag_regex),$page); I am not sure what tag is that you mean on class=something, but in this RE .. it should capture any p tags

Re: [PHP] Incorrect version shown in phpinfo() and phpversion() in 5.2.6

2008-05-06 Thread Mario Guenterberg
On Tue, May 06, 2008 at 02:00:33PM -0400, Scott Lerman wrote: Yup, I restarted Apache several times. The httpd.conf line I have is LoadModule php5_module C:/Program Files/PHP/php-5.2.6-Win32/php5apache2.dll. If nobody else has seen this problem, I'll just assume it's some oddity on my system.

Re: [PHP] PHP Web Apps OpenID

2008-05-06 Thread Chris
Joe Harman wrote: Hey Ya'll! I am curious here if any of you are considering or already using OpenID or Windows CardSpace? Does anyone see this being a big deal??? from a users stand point it seems like a big hassle to get started with it and I'm not sure if it would scare people away or

[PHP] the Y2K38 BUG

2008-05-06 Thread Chetan Rane
Hi all Have guys heard of the the Y2K38 Bug more details are on this link http://www.codeproject.com/KB/bugs/The-Year-2038-Bug.aspx Can there be a possible solution. As the system which I am developing for my client uses Unix timestamp. This might effect my application in the future

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Paul Scott
On Wed, 2008-05-07 at 10:03 +0530, Chetan Rane wrote: Have guys heard of the the Y2K38 Bug more details are on this link Nope, but I can guess what its about. Can there be a possible solution. As the system which I am developing for my client uses Unix timestamp. There are probably

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Nathan Nobbe
On Tue, May 6, 2008 at 10:57 PM, Paul Scott [EMAIL PROTECTED] wrote: On Wed, 2008-05-07 at 10:03 +0530, Chetan Rane wrote: Have guys heard of the the Y2K38 Bug more details are on this link Nope, but I can guess what its about. Can there be a possible solution. As the system which I am

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Stephen Johnson
Seriously If your apps are still being used in 2038 ... WOW! This is an issue that will more then likely be well resolved LONG before 2038... On 5/6/08 10:50 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Tue, May 6, 2008 at 10:57 PM, Paul Scott [EMAIL PROTECTED] wrote: On Wed,

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Paul Scott
On Tue, 2008-05-06 at 23:50 -0600, Nathan Nobbe wrote: true-that ;) anyway, the DateTime class is implemented as a 64-bit unsigned (i think) value. so if you use it you should be good to go. php echo date_create('2040-10-24')-format('M-d-Y'); Oct-24-2040 a 64bit unsigned int is best,