Re: [PHP] Formatting -- defining sections of code

2012-12-15 Thread tamouse mailing lists
On Dec 14, 2012 9:49 AM, "Andy McKenzie" wrote: > > Hey folks, kind of a strange question here. > > Basically, I've been trying to move my style from "self taught" to "Oh > yeah, there IS a standard for this." One of the things I frequently > want to do is define sections of my code: to take a s

Re: [PHP] Formatting -- defining sections of code

2012-12-14 Thread Larry Martell
On Fri, Dec 14, 2012 at 11:20 AM, Paul M Foster wrote: > On Fri, Dec 14, 2012 at 10:48:05AM -0500, Andy McKenzie wrote: > >> Hey folks, kind of a strange question here. >> >> Basically, I've been trying to move my style from "self taught" to "Oh >> yeah, there IS a standard for this." One of the

Re: [PHP] Formatting -- defining sections of code

2012-12-14 Thread Paul M Foster
On Fri, Dec 14, 2012 at 10:48:05AM -0500, Andy McKenzie wrote: > Hey folks, kind of a strange question here. > > Basically, I've been trying to move my style from "self taught" to "Oh > yeah, there IS a standard for this." One of the things I frequently > want to do is define sections of my code

Re: [PHP] Formatting

2011-01-25 Thread Jim Lucas
On 1/25/2011 9:05 PM, Ethan Rosenberg wrote: Dear list - I have a program with the following statement: $out = system('ls -l', $retval); The output is a string. How do I format the output to be in the Linux format, that is in columns. I cannot think of a way to use explode to do it. Advice and

Re: [PHP] Formatting

2011-01-25 Thread joris ros
Hi You can try something like this: > Ethan Rosenberg wrote: > >> Dear list - >> >> I have a program with the following statement: $out = system('ls -l', >> $retval); The output is a string. How do I format the output to be in >> the Linux format, that is in columns. I cannot think of a way to u

Re: [PHP] Formatting

2011-01-25 Thread Donovan Brooke
Ethan Rosenberg wrote: Dear list - I have a program with the following statement: $out = system('ls -l', $retval); The output is a string. How do I format the output to be in the Linux format, that is in columns. I cannot think of a way to use explode to do it. Advice and comments, please. Tha

[PHP] Formatting

2011-01-25 Thread Ethan Rosenberg
Dear list - I have a program with the following statement: $out = system('ls -l', $retval); The output is a string. How do I format the output to be in the Linux format, that is in columns. I cannot think of a way to use explode to do it. Advice and comments, please. Thanks Ethan MySQ

RE: [PHP] Formatting an ECHO statement.

2010-10-19 Thread Bob McConnell
From: Cris S > Someone needs to hire me now, to keep me busy and stop me > from taking this issue apart one piece at a time. Kee-rist. That's not likely to happen soon. You have demonstrated here that you are immature and have very little self-control or self-respect. There is no way you would be

Re: [PHP] Formatting an ECHO statement.

2010-10-19 Thread tedd
At 12:39 AM -0400 10/19/10, Paul M Foster wrote: On Mon, Oct 18, 2010 at 10:46:41PM -0400, Cris S wrote: -snip- (of no importance) Please go back to lurking. We'd all appreciate it, and you'll be happier. Paul -- Paul M. Foster I agree with Paul on this one. Chris S has no idea of what we

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread a...@ashleysheridan.co.uk
http://www.ashleysheridan.co.uk - Reply message - From: "Cris S" Date: Tue, Oct 19, 2010 03:46 Subject: [PHP] Formatting an ECHO statement. To: At 15:12 18 10 10, Shreyas Agasthya wrote: >Thanks all for their input. Some of the learnings from the thread : > >1. tag is getting deprec

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Shreyas Agasthya
Thanks for that detailed mail, Admin. The was an example and I wanted to understand how does one go about the whole formatting. Nonetheless, I am pretty well informed after this thread. Thanks once again, everyone. Regards, Shreyas On Tue, Oct 19, 2010 at 10:09 AM, Paul M Foster wrote: > On Mo

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Paul M Foster
On Mon, Oct 18, 2010 at 10:46:41PM -0400, Cris S wrote: > At 15:12 18 10 10, Shreyas Agasthya wrote: > >Thanks all for their input. Some of the learnings from the thread : > > > >1. tag is getting deprecated. > > Not in HTML5. > > >2. Use and > > Both? Read that shit again, buckwheat. And b

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Cris S
At 15:12 18 10 10, Shreyas Agasthya wrote: Thanks all for their input. Some of the learnings from the thread : 1. tag is getting deprecated. Not in HTML5. 2. Use and Both? Read that shit again, buckwheat. And by "that shit" I do mean the standards, not what Joe Bloe told you. 3. Have

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Cris S
(including search engines, screen readers, etc) to infer a meaning for than important message Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "tedd" Date: Mon, Oct 18, 2010 17:51 Subject: [PHP] Formatting an ECHO statement. To: At 9:47 AM -0400 10/18/10, Steve

RE: [PHP] Formatting an ECHO statement.

2010-10-18 Thread admin
c, and I would not use static filters personally. It is meant as an explanation, not a how to. -Original Message- From: Shreyas Agasthya [mailto:shreya...@gmail.com] Sent: Monday, October 18, 2010 6:10 AM To: PHP General List Subject: [PHP] Formatting an ECHO statement. Team, A

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Shreyas Agasthya
Thanks all for their input. Some of the learnings from the thread : 1. tag is getting deprecated. 2. Use and 3. Have CSS used to do the kind of stuff I was trying. I must inform, this was already in place. 4. Keep an eye on the SE monster. Regards, Shreyas On Mon, Oct 18, 2010 at 11:43 PM, A

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Andrew Ballard
On Mon, Oct 18, 2010 at 1:28 PM, tedd wrote: > At 6:03 PM +0100 10/18/10, a...@ashleysheridan.co.uk wrote: >> >> There's nothing wrong with using as it indicates emphasised text, >> which is semantic. Use span tags with classes only when the content you're >> styling has no semantic alternative.

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread tedd
At 6:03 PM +0100 10/18/10, a...@ashleysheridan.co.uk wrote: There's nothing wrong with using as it indicates emphasised text, which is semantic. Use span tags with classes only when the content you're styling has no semantic alternative. important message is much better for machines (includi

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread tedd
At 9:47 AM -0400 10/18/10, Steve Staples wrote: or create a style sheet, with a class definition for italic. Steve. +1 The "best practices" way to do it. Don't style output in an echo statement, but rather put styling in a css sheet, It's much cleaner there. Cheers, tedd -- --- htt

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Steve Staples
On Mon, 2010-10-18 at 09:25 -0400, Paul M Foster wrote: > On Mon, Oct 18, 2010 at 03:40:03PM +0530, Shreyas Agasthya wrote: > > > Team, > > > > A bit of silly one but like my book says, there are no dumb questions, I am > > asking it here. > > > > If I have : > > > > $other="Whatever"; > > > >

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Paul M Foster
On Mon, Oct 18, 2010 at 03:40:03PM +0530, Shreyas Agasthya wrote: > Team, > > A bit of silly one but like my book says, there are no dumb questions, I am > asking it here. > > If I have : > > $other="Whatever"; > > and I do: > > echo 'Other Comments:' .$other. ' > > works perfectly well and

RE: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Tommy Pham
> -Original Message- > From: Shreyas Agasthya [mailto:shreya...@gmail.com] > Sent: Monday, October 18, 2010 3:10 AM > To: PHP General List > Subject: [PHP] Formatting an ECHO statement. > > Team, > > A bit of silly one but like my book says, there are no dumb

RE: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Ford, Mike
> -Original Message- > From: Shreyas Agasthya [mailto:shreya...@gmail.com] > Sent: 18 October 2010 11:10 > > A bit of silly one but like my book says, there are no dumb > questions, I am > asking it here. > > If I have : > > $other="Whatever"; > > and I do: > > echo 'Other Comments:' .

[PHP] Formatting an ECHO statement.

2010-10-18 Thread Shreyas Agasthya
Team, A bit of silly one but like my book says, there are no dumb questions, I am asking it here. If I have : $other="Whatever"; and I do: echo 'Other Comments:' .$other. ' works perfectly well and prints the value. What if I want to, now, italicize the value of $other with the above syntax?

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
Thank you Nathan, This worked quite well. --Rick On Jan 22, 2010, at 8:10 PM, Nathan Rixham wrote: Rick Dwyer wrote: On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. np - here's a more condensed version: function round_to_half_cent( $value ) { $

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Nathan Rixham
Rick Dwyer wrote: > On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: > Thanks Nathan I'll give it a shot. > np - here's a more condensed version: function round_to_half_cent( $value ) { $value = ($value*100) + 0.3; $out = number_format( floor($value)/100 , 2 ); return $o

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. --Rick your doing the number format before the rounding.. here's a version of the function that should fit the bill: function round_to_half_cent( $value ) { $value *= 100; if( $value ==

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Nathan Rixham
Rick Dwyer wrote: > > On Jan 22, 2010, at 4:24 PM, tedd wrote: > >>> Hello List. >>> >>> In an earlier post, I received help with a custom function to round >>> decimals off (the custom function provided by Adam Richardson is below). >>> >>> However in my MySQL db, when I have values with only 1

Re: [PHP] Formatting Decimals

2010-01-22 Thread Nathan Rixham
Paul M Foster wrote: > On Mon, Jan 11, 2010 at 04:56:03PM -0500, tedd wrote: > >> --Rick: >> >> The above described rounding algorithm introduces more bias than >> simply using PHP's round() function, which always rounds down. IMO, >> modifying rounding is not worth the effort. >> >> The "best" ro

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 4:24 PM, tedd wrote: Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP r

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread tedd
Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP returns to display as 2. For example, 3.8 need

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP returns to display as 2. For example, 3.8 need

Re: [PHP] Formatting Decimals

2010-01-11 Thread Paul M Foster
On Mon, Jan 11, 2010 at 04:56:03PM -0500, tedd wrote: > > --Rick: > > The above described rounding algorithm introduces more bias than > simply using PHP's round() function, which always rounds down. IMO, > modifying rounding is not worth the effort. > > The "best" rounding algorithm is to look at

Re: [PHP] Formatting Decimals

2010-01-11 Thread Adam Richardson
On Mon, Jan 11, 2010 at 7:45 PM, Mattias Thorslund wrote: > tedd wrote: > >> At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: >> >>> I have been asked to further modify the value to the nearest half cent. >>> >>> So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 >>> If it ends in 3,

Re: [PHP] Formatting Decimals

2010-01-11 Thread Mattias Thorslund
tedd wrote: At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: I have been asked to further modify the value to the nearest half cent. So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9 it gets rounded up to full ce

Re: [PHP] Formatting Decimals

2010-01-11 Thread Rick Dwyer
On Jan 11, 2010, at 4:56 PM, tedd wrote: At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: I have been asked to further modify the value to the nearest half cent. So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or

Re: [PHP] Formatting Decimals

2010-01-11 Thread tedd
At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: I have been asked to further modify the value to the nearest half cent. So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9 it gets rounded up to full cents. Can th

Re: [PHP] Formatting Decimals

2010-01-11 Thread Paul M Foster
On Mon, Jan 11, 2010 at 02:55:33PM -0500, Rick Dwyer wrote: > I have been asked to further modify the value to the nearest half cent. > > So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 > If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9 it > gets rounded up

Re: [PHP] Formatting Decimals

2010-01-11 Thread Rick Dwyer
I have been asked to further modify the value to the nearest half cent. So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9 it gets rounded up to full cents. Can this be done fairly easily? Not knowing PHP w

Re: [PHP] Formatting Decimals

2010-01-11 Thread Ryan Sun
$newprice = sprintf("$%.2f", 15.109); On Sun, Jan 10, 2010 at 8:36 PM, Rick Dwyer wrote: > Hello List. > > Probably an easy question, but I am not able to format a number to round up > from 3 numbers after the decimal to just 2. > > My code looks like this: > > $newprice = "$".number_format($ol

Re: [PHP] Formatting Decimals

2010-01-10 Thread Mattias Thorslund
Testing this out a little: matt...@mumin:~$ php -r 'echo "\$".number_format(0.109, 2, ".", ",")."\n";' $0.11 matt...@mumin:~$ php -r 'echo "$".number_format(0.109, 2, ".", ",")."\n";' $0.11 matt...@mumin:~$ php -r 'echo "$".number_format("0.109", 2, ".", ",")."\n";' $0.11 I think the $ should

[PHP] Formatting Decimals

2010-01-10 Thread Rick Dwyer
Hello List. Probably an easy question, but I am not able to format a number to round up from 3 numbers after the decimal to just 2. My code looks like this: $newprice = "$".number_format($old_price, 2, ".", ","); and this returns "$0.109" when I am looking for "$0.11". I tried: $newprice

Re: [PHP] Formatting plain text file

2009-07-30 Thread kranthi
\n"; } wont this do ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Formatting plain text file

2009-07-30 Thread b
On 07/30/2009 06:29 PM, Skip Evans wrote: Jim Lucas wrote: Skip Evans wrote: Hey all, Am I brain fading or what? I'm so used to formatting text in tables for HTML display I can't think of how to do it for a plain text file. I just need to create a columned table of names and addresses type st

Re: [PHP] Formatting plain text file

2009-07-30 Thread Robert Cummings
Skip Evans wrote: Jim Lucas wrote: Skip Evans wrote: Hey all, Am I brain fading or what? I'm so used to formatting text in tables for HTML display I can't think of how to do it for a plain text file. I just need to create a columned table of names and addresses type stuff... sprintf? or a li

Re: [PHP] Formatting plain text file

2009-07-30 Thread Skip Evans
Jim Lucas wrote: Skip Evans wrote: Hey all, Am I brain fading or what? I'm so used to formatting text in tables for HTML display I can't think of how to do it for a plain text file. I just need to create a columned table of names and addresses type stuff... sprintf? or a little str_pad on ea

Re: [PHP] Formatting plain text file

2009-07-30 Thread Jim Lucas
Skip Evans wrote: > Hey all, > > Am I brain fading or what? I'm so used to formatting text in tables for > HTML display I can't think of how to do it for a plain text file. > > I just need to create a columned table of names and addresses type > stuff... sprintf? or a little str_pad on each vari

[PHP] Formatting plain text file

2009-07-30 Thread Skip Evans
Hey all, Am I brain fading or what? I'm so used to formatting text in tables for HTML display I can't think of how to do it for a plain text file. I just need to create a columned table of names and addresses type stuff... sprintf? -- Skip Evans Big Sky

Re: [PHP] formatting - design question

2009-06-08 Thread PJ
Ford, Mike wrote: > On 04 June 2009 19:09, PJ advised: > > >> Nitsan Bin-Nun wrote: >> From my experience I tend to use a difference ID for the >> body tag, for >> >>> instance and then format it in my CSS using ID >>> reference: #homepage .classname { >>> col

Re: [PHP] formatting - design question

2009-06-05 Thread PJ
Peter Ford wrote: > PJ wrote: > >> tedd wrote: >> >>> At 3:58 PM -0400 6/4/09, PJ wrote: >>> tedd wrote: > Style sheets are meant simplify things so decide on how you want > things to look uniformly throughout your site and then stick with it. >

RE: [PHP] formatting - design question

2009-06-05 Thread Ford, Mike
On 04 June 2009 19:09, PJ advised: > Nitsan Bin-Nun wrote: >>> From my experience I tend to use a difference ID for the > body tag, for >> instance and then format it in my CSS using ID >> reference: #homepage .classname { >> color: blue; >> } >> >> This way you can use a default format fo

Re: [PHP] formatting - design question

2009-06-05 Thread tedd
At 10:23 AM +0100 6/5/09, Peter Ford wrote: PJ wrote: > tedd wrote: >> First you figure out a layout, then you populate it. You don't pick a >> layout, populate it and then change the layout. >> If only it were that simple. When one is developing, one is always changing. And even when you'

Re: [PHP] formatting - design question

2009-06-05 Thread tedd
At 4:54 PM -0400 6/4/09, PJ wrote: tedd wrote: > That's simply an example of not thinking things out before you write the code. First you figure out a layout, then you populate it. You don't pick a > layout, populate it and then change the layout. > > If only it were that simple. When on

Re: [PHP] formatting - design question

2009-06-05 Thread Peter Ford
PJ wrote: > tedd wrote: >> At 3:58 PM -0400 6/4/09, PJ wrote: >>> tedd wrote: >>> >>> > Style sheets are meant simplify things so decide on how you want things to look uniformly throughout your site and then stick with it. There's really no good reason to keep changing things throughou

Re: [PHP] formatting - design question

2009-06-04 Thread PJ
tedd wrote: > At 3:58 PM -0400 6/4/09, PJ wrote: >> tedd wrote: >> >> > Style sheets are meant simplify things so decide on how you want >>> things to look uniformly throughout your site and then stick with it. >>> There's really no good reason to keep changing things throughout a >>> site. >>>

Re: [PHP] formatting - design question

2009-06-04 Thread tedd
At 3:58 PM -0400 6/4/09, PJ wrote: tedd wrote: > Style sheets are meant simplify things so decide on how you want things to look uniformly throughout your site and then stick with it. There's really no good reason to keep changing things throughout a site. Cheers, tedd Maybe I'm just

Re: [PHP] formatting - design question

2009-06-04 Thread PJ
tedd wrote: > At 2:08 PM -0400 6/4/09, PJ wrote: >> Nitsan Bin-Nun wrote: >>> >From my experience I tend to use a difference ID for the body tag, >>> for >>> instance and then format it in my CSS using ID >>> reference: >>> #homepage .classname { >>>color: blue; >>> } >>> >>> This wa

Re: [PHP] formatting - design question

2009-06-04 Thread tedd
At 2:08 PM -0400 6/4/09, PJ wrote: Nitsan Bin-Nun wrote: >From my experience I tend to use a difference ID for the body tag, for instance and then format it in my CSS using ID reference: #homepage .classname { color: blue; } This way you can use a default format for all the pages

Re: [PHP] formatting - design question

2009-06-04 Thread PJ
Nitsan Bin-Nun wrote: > >From my experience I tend to use a difference ID for the body tag, for > instance and then format it in my CSS using ID > reference: > #homepage .classname { > color: blue; > } > > This way you can use a default format for all the pages and create minor (or > major)

Re: [PHP] formatting - design question

2009-06-04 Thread Nitsan Bin-Nun
>From my experience I tend to use a difference ID for the body tag, for instance and then format it in my CSS using ID reference: #homepage .classname { color: blue; } This way you can use a default format for all the pages and create minor (or major) changes in the theme in no time :) I w

Re: [PHP] formatting - design question

2009-06-04 Thread Shawn McKenzie
Andrew Ballard wrote: > On Thu, Jun 4, 2009 at 12:54 PM, PJ wrote: >> This may not be strictly php but I think is may be relevant. >> Were I to use a different css file for every page (that is slightly >> different), would that affect performance? >> It seems to me that might be a way of simplifyi

Re: [PHP] formatting - design question

2009-06-04 Thread Andrew Ballard
On Thu, Jun 4, 2009 at 12:54 PM, PJ wrote: > This may not be strictly php but I think is may be relevant. > Were I to use a different css file for every page (that is slightly > different), would that affect performance? > It seems to me that might be a way of simplifying and certainly speeding >

[PHP] formatting - design question

2009-06-04 Thread PJ
This may not be strictly php but I think is may be relevant. Were I to use a different css file for every page (that is slightly different), would that affect performance? It seems to me that might be a way of simplifying and certainly speeding up development (design-wise, anyway) when using css. A

Re: [PHP] Formatting output

2007-06-11 Thread Stut
[EMAIL PROTECTED] wrote: I would like to format the output of a PHP page into a single line and use gzip compression too. I know that i can use something like this to get in a single line ( will workout on this function later to remove spaces ). And gzip compression is used with Is there a

[PHP] Formatting output

2007-06-11 Thread listas
Hello, I would like to format the output of a PHP page into a single line and use gzip compression too. I know that i can use something like this to get in a single line ( will workout on this function later to remove spaces ). And gzip compression is used with Is there a way to "mix" those

Re: [PHP] Formatting time :/

2007-01-02 Thread Richard Lynch
If it is stored in a database, you may want to convert within your query: MySQL: date_format Postgresql: to_char If it's just in a text file, PHP's date() function should do it: http://php.net/date I dunno if there's a nifty constant for the format you want, but you could always mess with mktime

RE: [PHP] Formatting time :/

2007-01-02 Thread Steven Macintyre
t > Subject: Re: [PHP] Formatting time :/ > > Steven Macintyre wrote: > > I am unable to find out how to do this ... or what the format is > "called" > > bar zulu format > > > > I have standard 00:00:00 time stored ... and wish to display it > as 00h

Re: [PHP] Formatting time :/

2007-01-02 Thread Stut
Steven Macintyre wrote: I am unable to find out how to do this ... or what the format is "called" bar zulu format I have standard 00:00:00 time stored ... and wish to display it as 00h00 ... has anyone done this with php ... can you point me to right page etc ... What is that format called? h

[PHP] Formatting time :/

2007-01-02 Thread Steven Macintyre
Hi all, I am unable to find out how to do this ... or what the format is "called" bar zulu format I have standard 00:00:00 time stored ... and wish to display it as 00h00 ... has anyone done this with php ... can you point me to right page etc ... What is that format called? Kind Regards, S

Re: [PHP] Formatting Question

2006-10-05 Thread Toby Osbourn
Thanks to everyone for their suggestions, I used the nl2br function in the end, and it works perfectly. On 02/10/06, Richard Lynch <[EMAIL PROTECTED]> wrote: On Mon, October 2, 2006 4:13 pm, tedd wrote: > Why not use nl2br() to show the data in the browser and leave the > data "as-is" in the dB

Re: [PHP] Formatting Question

2006-10-02 Thread Richard Lynch
On Mon, October 2, 2006 4:13 pm, tedd wrote: > Why not use nl2br() to show the data in the browser and leave the > data "as-is" in the dB? Apparently I typed too much, cuz that's exactly what I said, or meant to say... -- Some people have a "gift" link here. Know what I want? I want you to buy a

Re: [PHP] Formatting Question

2006-10-02 Thread tedd
At 3:51 PM -0500 10/2/06, Richard Lynch wrote: Don't "pollute" your raw data (the newlines) with a very media-specific formatting code ("") -- Keep your raw data pure and clean, and format for the destination when you send it there, not when you store it. There *might* be some egregious examples

Re: [PHP] Formatting Question

2006-10-02 Thread Richard Lynch
On Mon, October 2, 2006 12:08 pm, Toby Osbourn wrote: > Sorry to plague you with a question that should have a simple answer, > but I > can't find said answer anywhere (probably looking for the wrong things > in > the wrong places!) > > Basically I want to allow a user to input a string via a form

Re: [PHP] Formatting Question

2006-10-02 Thread tedd
At 6:08 PM +0100 10/2/06, Toby Osbourn wrote: Sorry to plague you with a question that should have a simple answer, but I can't find said answer anywhere (probably looking for the wrong things in the wrong places!) Basically I want to allow a user to input a string via a form into a database, I

Re: [PHP] Formatting Question

2006-10-02 Thread Dave Goodchild
How is the field set in the database - is it CHAR/VARCHAR or TEXT? -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk

[PHP] Formatting Question

2006-10-02 Thread Toby Osbourn
Sorry to plague you with a question that should have a simple answer, but I can't find said answer anywhere (probably looking for the wrong things in the wrong places!) Basically I want to allow a user to input a string via a form into a database, I have the code to do that and it works almost 10

[PHP] Formatting of a.m. and p.m.

2006-05-23 Thread Kevin Murphy
date("a"); > output = AM Is there any easy way to change the formatting of the output of above from "am" to "a.m." in order to conform to AP style? Something like this below would work, but I'm wondering if there is something I could do differently in the date() fuction to make it work:

Re: [PHP] Formatting a Time field

2006-03-23 Thread Richard Lynch
On Thu, March 23, 2006 5:51 pm, Todd Cary wrote: > I have a field, Start_Time, in a MySQL DB. Since it is not a > TimeStamp, I believe I cannot use date(), correct? > > I would like to format 09:00:00 to 9:00 AM. > > If I convert the 09:00:00 with the strtotime(), I get a couple of > extra minutes

Re: [PHP] Formatting a Time field

2006-03-23 Thread Tom Rogers
Hi, Friday, March 24, 2006, 9:51:48 AM, you wrote: TC> I have a field, Start_Time, in a MySQL DB. Since it is not a TC> TimeStamp, I believe I cannot use date(), correct? TC> I would like to format 09:00:00 to 9:00 AM. TC> If I convert the 09:00:00 with the strtotime(), I get a couple of TC>

[PHP] Formatting a Time field

2006-03-23 Thread Todd Cary
I have a field, Start_Time, in a MySQL DB. Since it is not a TimeStamp, I believe I cannot use date(), correct? I would like to format 09:00:00 to 9:00 AM. If I convert the 09:00:00 with the strtotime(), I get a couple of extra minutes added. Suggestions are welcomed Todd -- PHP Gener

Re: [PHP] Formatting of a number

2005-11-16 Thread David Grant
Hi Scott, How do you distinguish between a value filled with zeroes and a value with 0 in both decimal positions? For example, why is 3145900 expressed as 3,145.90, and not 31,459.00? Cheers, David Grant Scott Parks wrote: > Hi- > > I have a number that I am trying to format. It is data comi

[PHP] Formatting of a number

2005-11-16 Thread Scott Parks
Hi- I have a number that I am trying to format. It is data coming from a main frame and has 8 characters assigned to it (6 and two decimal places). I have zerofill set up in MySQL on this field and am working on the best way to display the number. Currently I have this: $sOutput = numb

Re: [PHP] formatting problems:

2005-08-16 Thread Ryan A
On 8/16/2005 9:59:30 PM, Scott Noyes ([EMAIL PROTECTED]) wrote: > It's not clear to me how strict you want to be regarding the > formatting. Are you trying to keep scenes together on each line, or > just dump everything and let it wrap where it needs to? Perhaps you > could handcode a sample and

Re: [PHP] formatting problems:

2005-08-16 Thread Scott Noyes
It's not clear to me how strict you want to be regarding the formatting. Are you trying to keep scenes together on each line, or just dump everything and let it wrap where it needs to? Perhaps you could handcode a sample and post a link. I'd also guess that you could make good use of CSS, specif

[PHP] formatting problems:

2005-08-16 Thread Ryan A
Hi, My database has a table called movies which has data like this: flick_name ,flick_cover, part_url flick_name is the name of the movie, the movie is cut into several pieces for faster downloads part_url is the full path to each of the pieces eg: home movie 1 ,a.gif, http://movieserver.com/s

Re: [PHP] formatting paragraphs in to strings

2005-06-13 Thread Philip Hallstrom
Good point. Only problem is, if someone hit enter a-million times, you would end up with a-million spaces where the "\n" characters were. To take care of that repetition, maybe something like: while (strpos($textarea_text, "\n\n")) { . } would be one way you could do it. $new_str =

Re: [PHP] formatting paragraphs in to strings

2005-06-13 Thread Richard Lynch
On Mon, June 13, 2005 12:06 pm, Paul Nowosielski said: > I'm having a perplexing problem. I'm gather data through a > html from field and dumping it to MySQL. > > I want to display the data as a long string with no carriage returns or > line breaks in a dhtml div window. What styles have you ap

Re: [PHP] formatting paragraphs in to strings

2005-06-13 Thread John Browne
Right.. But the browser also should be ignoring the carriage returns as well, which makes me think the div is set to "white-space: pre;" or something. He said the text is being formatted in a div exactly how it is entered into the system. By default, a div does not render any carriage returns.

RE: [PHP] formatting paragraphs in to strings

2005-06-13 Thread Murray @ PlanetThoughtful
> Good point. Only problem is, if someone hit enter a-million times, > you would end up with a-million spaces where the "\n" characters were. > To take care of that repetition, maybe something like: > > > while (strpos($textarea_text, "\n\n")) { > . > } > > > would be one way you cou

Re: [PHP] formatting paragraphs in to strings

2005-06-13 Thread John Browne
Good point. Only problem is, if someone hit enter a-million times, you would end up with a-million spaces where the "\n" characters were. To take care of that repetition, maybe something like: while (strpos($textarea_text, "\n\n")) { . } would be one way you could do it. On 6/13/05

RE: [PHP] formatting paragraphs in to strings

2005-06-13 Thread Murray @ PlanetThoughtful
> Use the PHP str_replace function before writing it to the DB. Replace > all "\n" characters with an empty string "". > > http://us2.php.net/manual/en/function.str-replace.php I think it might be better to replace all "\n" characters with spaces " ", otherwise you will end up with sentences tha

Re: [PHP] formatting paragraphs in to strings

2005-06-13 Thread John Browne
Use the PHP str_replace function before writing it to the DB. Replace all "\n" characters with an empty string "". http://us2.php.net/manual/en/function.str-replace.php On 6/13/05, Paul Nowosielski <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having a perplexing problem. I'm gather data through a

[PHP] formatting paragraphs in to strings

2005-06-13 Thread Paul Nowosielski
Hi, I'm having a perplexing problem. I'm gather data through a html from field and dumping it to MySQL. I want to display the data as a long string with no carriage returns or line breaks in a dhtml div window. The problem I'm have is that the form data is remembering the carriage returns. I

Re: [PHP] formatting logic

2005-04-21 Thread Andy Pieters
Hi First, execute your query unset($fail); $res=mysql_query($sql,$dbhandle) or $fail=true; if( (isset($fail)) || (!(is_resource($res)) ) echo "There was a problem with the execution of the query"; if(mysql_num_rows($res)==0) echo "The query resulted in ZERO records"; #now that's out of the way

Re: [PHP] formatting logic

2005-04-21 Thread Philip Hallstrom
I am allowing our members to upload pictures and they can choose which category the pictures go under, the first category "public" is made for them. When I sql the DB I call it like this: select picture_names<,more fields> from where member_id= order by category. which i display something lik

[PHP] formatting logic

2005-04-21 Thread Ryan A
Hi, Am having a bit of logic problem figuring this outI just think the easy solution would cost me in having too many sql queries from my script so there has to be a easier way. I am allowing our members to upload pictures and they can choose which category the pictures go under, the first ca

Re: [PHP] Formatting e-mail using mail()

2005-02-23 Thread Jochem Maas
Burhan Khalid wrote: Jacques wrote: Can I format an e-mail message with html tags inside the mail() function? If not, how can I go about it? I would like to format the layout of the e-mail message using tables, colors and perhaps images. Please, FFS RTFM > http://www.php.net/manual/en/function.m

Re: [PHP] Formatting e-mail using mail()

2005-02-22 Thread Burhan Khalid
Jacques wrote: Can I format an e-mail message with html tags inside the mail() function? If not, how can I go about it? I would like to format the layout of the e-mail message using tables, colors and perhaps images. Please, FFS RTFM > http://www.php.net/manual/en/function.mail.php -- PHP General

[PHP] Formatting e-mail using mail()

2005-02-22 Thread Jacques
Can I format an e-mail message with html tags inside the mail() function? If not, how can I go about it? I would like to format the layout of the e-mail message using tables, colors and perhaps images. Regards - Jacques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re[2]: [PHP] formatting a string

2004-04-24 Thread Tom Rogers
Hi, Sunday, April 25, 2004, 3:15:25 PM, you wrote: AB> ok sorry but since i never used preg_* before i dont quite get what some of AB> this stuff means. i looked at the doc page for it but it doesnt make mention AB> at all of what \d, \w, \s or any of those things mean... i only assume that AB> \

  1   2   3   >