Azaz Posted July 29, 2010 Share Posted July 29, 2010 if ( $r['warn'] >= 100 ) { $warn = '<img src=\'images/10.gif\'>'; $precent = "<font color=red>100</font>"; } else if ( $r['warn'] >= 90 ) { $warn = '<img src=\'images/9.gif\'>'; $precent = "90"; } else if ( $r['warn'] >= 80 ) { $warn = '<img src=\'images/8.gif\'>'; $precent = "80"; } else if ( $r['warn'] >= 70 ) { $warn = '<img src=\'images/7.gif\'>'; $precent = "70"; } else if ( $r['warn'] >= 60 ) { $warn = '<img src=\'images/6.gif\'>'; $precent = "60"; } else if ( $r['warn'] >= 50 ) { $warn = '<img src=\'images/5.gif\'>'; $precent = "50"; } else if ( $r['warn'] >= 40 ) { $warn = '<img src=\'images/4.gif\'>'; $precent = "40"; } else if ( $r['warn'] >= 30 ) { $warn = '<img src=\'images/3.gif\'>'; $precent = "30"; } else if ( $r['warn'] >= 20 ) { $warn = '<img src=\'images/2.gif\'>'; $precent = "20"; } else if ( $r['warn'] >= 10 ) { $warn = '<img src=\'images/1.gif\'>'; $precent = "10";} else if ( $r['warn'] <= 9 ){$warn = '<img src=\'images/0.gif\'>';$precent = "0";} I need to find a program that automatically squishes everything into 1 line of code, because I will not need to edit this code ever again, lol! Thanks! and it's taking to much space in my coding area Link to comment https://forums.phpfreaks.com/topic/209209-php-squisher/ Share on other sites More sharing options...
dreamwest Posted July 29, 2010 Share Posted July 29, 2010 strip($text, $replace = ' ') { return preg_replace('!\s+!', $replace, $text); } Link to comment https://forums.phpfreaks.com/topic/209209-php-squisher/#findComment-1092513 Share on other sites More sharing options...
Azaz Posted July 29, 2010 Author Share Posted July 29, 2010 really? lol Link to comment https://forums.phpfreaks.com/topic/209209-php-squisher/#findComment-1092515 Share on other sites More sharing options...
dreamwest Posted July 29, 2010 Share Posted July 29, 2010 just a guess, but itll remove all whitespace in a string making it into 1 line of code Link to comment https://forums.phpfreaks.com/topic/209209-php-squisher/#findComment-1092516 Share on other sites More sharing options...
Azaz Posted July 29, 2010 Author Share Posted July 29, 2010 Ok thanks, and this query isn't working can u find out why? mysql_query("UPDATE friends SET accepted='1' WHERE friend_id='$id' AND id='{$_SESSION['user_id']}"); Redirect( "You have Successfully accepted this user", './?act=Friends&m=Pending' ); It's for my friend system for my forum I am creating... It doesn't pop any errors but I cannot see it change in my database table hmm... ROFL I FORGOT THE " ' " after } ZZ..my bad delete this post, lol ok thx 4 ur script zzzzzzzz Link to comment https://forums.phpfreaks.com/topic/209209-php-squisher/#findComment-1092518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.