How to separate letters and digits from a string in php

后端 未结 8 2042
攒了一身酷
攒了一身酷 2020-11-29 09:37

I have a string which is combination of letters and digits. For my application i have to separate a string with letters and digits: ex:If my string is \"12jan\" i hav to ge

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 10:12

    Try This :

    $string="12jan";
    $chars = '';
    $nums = '';
    for ($index=0;$indexNums: -$nums-";
    
    
    function isNumber($c) {
        return preg_match('/[0-9]/', $c);
    } 
    

提交回复
热议问题