<?php
ini_set('display_errors','on');
$string="1美元 = 7.47160789 人民币";
$match = '/\=(.+?)\人/i';
preg_match($match, $string,$res );
echo $res[1];
?>
测试过了.
ini_set('display_errors','on');
$string="1美元 = 7.47160789 人民币";
$match = '/\=(.+?)\人/i';
preg_match($match, $string,$res );
echo $res[1];
?>
测试过了.
preg_match("/=.*?\b([\d\.]+)\b/",$string,$m);
echo $m[1];