php - How to grab a word from a page -


i wondering how grab text external page using php. think preg_match() can can't how use it.

the text in page following:

dragontail-5.7.2.tgz 

and need grab only

5.7.2 

thank helping.

check out: https://regex101.com/r/cf8ms1/1

/([0-9.]+)/gm 

means "select integer characters since more 1, , include "." well, , give me of them, on multiline too. thank you." last thing delete last or first character ".", so:

if (preg_match('/([0-9.]+)/gm', $input, $matches)) {     $result = trim($matches[1], '.'); } else {     $result = null; } 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -