誰かが次のようなreadme.htmlファイルでWordPressバージョンを取得するための正規表現またはPHPの任意のメソッドを手伝ってくれるといいのですが。
<h1 id="logo" style="text-align: center">
<img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
<br /> Version 2.8.1
</h1>
ありがとうございました!
preg_match("/Version\s+([\d.]+)/", $html, $match);
$version = $match[1];
$doc = new DOMDocument;
$doc->loadHTML($html);
$text = trim($doc->getElementsByTagName("h1")->item(0)->textContent);
$index = strrpos($text, " ");
$version = substr($text, $index+1);
あなたはそれを必要としません。代わりに使用するget_bloginfo('version');
get_bloginfo('version')
-使用しているWordPressのバージョンを返します。このデータは、wp-includes/version.phpで設定された「$wp_version」変数から取得されます。
http://codex.wordpress.org/Function_Reference/get_bloginfo