zintis8789 Posted November 15, 2009 Report Share Posted November 15, 2009 (edited) Man vajag aizstāt decimālskaitli: 12.12 Ar skaitli: 12:12 Edited November 15, 2009 by zintis8789 Quote Link to comment Share on other sites More sharing options...
101111 Posted November 15, 2009 Report Share Posted November 15, 2009 (edited) ..un kur probleema? Edited November 15, 2009 by 101111 Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted November 15, 2009 Report Share Posted November 15, 2009 http://uk.php.net/str_replace Quote Link to comment Share on other sites More sharing options...
waplet Posted November 15, 2009 Report Share Posted November 15, 2009 <? $str = "12.12"; $str = str_replace(".",":",$str); echo $str; ?> Quote Link to comment Share on other sites More sharing options...
bubu Posted November 16, 2009 Report Share Posted November 16, 2009 Ja formāts vienmēr ir: cipars cipars . cipars cipars, tad vienkārši aizvieto trešo čarakteri: $str = "12.12"; $str[3] = ":"; Quote Link to comment Share on other sites More sharing options...
waplet Posted November 16, 2009 Report Share Posted November 16, 2009 a ja būs 1.23? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 16, 2009 Report Share Posted November 16, 2009 waplet, tad neizpildīsies nosacījums "Ja formāts vienmēr ir: cipars cipars . cipars cipars" Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 16, 2009 Author Report Share Posted November 16, 2009 Problēmu es atrisināju. Te ir kods : $mans_nummurs = number_format($v, 2, ':', ''); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.