dAivEd Posted October 8, 2009 Report Share Posted October 8, 2009 Labdien! Te tāds sīkumiņš: Ir vārds JANIS35 (viss kopā) vajag dabūt atsevišķi JANIS un atsevišķi 35, vai arī tikai JANIS, jo ka dabūt ciparus es zinu. Iepriekš paldies! Quote Link to comment Share on other sites More sharing options...
bubu Posted October 8, 2009 Report Share Posted October 8, 2009 Ja tu zini kā dabūt ciparus, tad ar strlen + substr funkciju tev nevajadzētu būt problēmām dabūt arī to vārdu. Bet es vispār te lietotu regexpu: (\D+)(\d+) Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 8, 2009 Author Report Share Posted October 8, 2009 Nu ciparus es dabonu caur $text = "JANIS35"; $text = preg_replace('/[^\d]/','',"$text"); sanāk 35, a kā dabūt vārdu ? Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 8, 2009 Author Report Share Posted October 8, 2009 Sorz nepamāniju ko tu lejā uzrakstiji, viss sanāca paldies! Quote Link to comment Share on other sites More sharing options...
Kemito Posted October 8, 2009 Report Share Posted October 8, 2009 Uzliec attiecīgu preg_match un viss būs čikiniekā! 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.