View Single Post
Old 14-07-2004, 17:00   #8
greencreeper
Inactive
 
Join Date: Nov 2003
Location: Leeds - the dog house
Age: 49
Services: Email me for a current price list
Posts: 8,270
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
Re: Filtering out comma's with PHP

$string_with_no_commas = number_format($price, 2, '.', '')

'' is two ' and not "

That should do it. Methinks it's the implicit conversion when you add the two prices that's at fault.

I also ltrim and rtrim the input string just in case.

Use switch/case instead of loads of if/else

I really wouldn't use Javascript - if the user disables Javascript then your site probably won't work. Client side data formatting and verification is for speed only - should always implement the same measures server side too.
greencreeper is offline   Reply With Quote