AndreyKlipikov

Cleaning prices

Sep 12th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. $prices = Prices::model()->findAll();
  2.  
  3. foreach($prices as $item)
  4. {
  5.     echo $item->id . ' ' . $item->price;
  6.  
  7.     $item->price = preg_replace("/[^0-9]/", "", $item->price);
  8.     $item->save(false);
  9.  
  10.     echo ' ' . $item->price . '<br>';
  11. }
Advertisement
Add Comment
Please, Sign In to add comment