Php - Formatear con puntos RUT


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function getPuntosRut( $rut ){
  2. $rutTmp = explode( "-", $rut );
  3. return number_format( $rutTmp[0], 0, "", ".") . '-' . $rutTmp[1];
  4. }
  5.  
  6. echo getPuntosRut('12345678-9');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.