PHP RegEx - Get All Digits -


मेरे पास यह कोड है:

  $ string = "123456ABcd9999"; $ Answer = ereg ("([0-9] *)", $ स्ट्रिंग, $ अंक); $ अंकों गूंज [0];  

यह आउटपुट '123456' मुझे इसे '1234569999' यानी आउटपुट करना चाहिए। सभी अंक इसे कैसे प्राप्त किया जा सकता है। मैं कई अलग-अलग regex चीजों की कोशिश कर रहा हूं लेकिन यह समझ नहीं पा रहा है

आप इसके लिए उपयोग कर सकते हैं, preg_replace ("/ [^ 0-9] /" , "", $ स्ट्रिंग) उदाहरण के लिए


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -