Search found 4 matches

by SurfScape
Mon Dec 15, 2003 11:35 pm
Forum: PHP - Code
Topic: whole number/division/modulus?
Replies: 2
Views: 312

Here is the code, I used, works like a charm foreach ( $_POST&#1111;'data'] as $k => $v ) &#123; $v = sprintf( "%01.2f", $v ); $decimals = substr($v, -2); if (($decimals % 25) != 0) &#123; $site->raise_error( 'All data must be either .25, .50, .75, .00.<br> See the rounding cha...
by SurfScape
Mon Dec 15, 2003 10:41 pm
Forum: PHP - Code
Topic: whole number/division/modulus?
Replies: 2
Views: 312

whole number/division/modulus?

I have an array, I want to check for errors before placing in my db. &#1111;data] => Array ( &#1111;E001] => 40.00 &#1111;E021] => 2.25 &#1111;E022] => 1.16 &#1111;E01S] => 0.00 &#1111;E012] => 0.00 &#1111;E09B] => 0.00 ) Now, these values can only have possible values of...
by SurfScape
Mon Dec 15, 2003 5:30 pm
Forum: PHP - Code
Topic: array help
Replies: 2
Views: 388

Solution

Here is the solution: if ( is_array( $_POST&#1111;'data'] ) ) &#123; $values = $_POST&#1111;'data']; $keys = array_keys($_POST&#1111;'data']); for ($i=0; $i < count($keys); $i++ ) &#123; $pay_types&#1111;$keys&#1111;$i]]&#1111;'value'] = sprintf("%01.2f",$va...
by SurfScape
Mon Dec 15, 2003 2:50 am
Forum: PHP - Code
Topic: array help
Replies: 2
Views: 388

array help

I have 2 arrays: Array ( &#1111;employee_id] => 13351 &#1111;data] => Array ( &#1111;E001] => 40 &#1111;E021] => 10 &#1111;E022] => &#1111;E09B] => ) and Array ( &#1111;E001] => Array ( &#1111;earnings_code] => E001 &#1111;description] => Regular Hours/Earnings &a...