zintis8789 Posted November 15, 2009 Report Posted November 15, 2009 (edited) Man vajag aizstāt decimālskaitli: 12.12 Ar skaitli: 12:12 Edited November 15, 2009 by zintis8789 Quote
101111 Posted November 15, 2009 Report Posted November 15, 2009 (edited) ..un kur probleema? Edited November 15, 2009 by 101111 Quote
waplet Posted November 15, 2009 Report Posted November 15, 2009 <? $str = "12.12"; $str = str_replace(".",":",$str); echo $str; ?> Quote
bubu Posted November 16, 2009 Report 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
Aleksejs Posted November 16, 2009 Report Posted November 16, 2009 waplet, tad neizpildīsies nosacījums "Ja formāts vienmēr ir: cipars cipars . cipars cipars" Quote
zintis8789 Posted November 16, 2009 Author Report Posted November 16, 2009 Problēmu es atrisināju. Te ir kods : $mans_nummurs = number_format($v, 2, ':', ''); Quote
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.