使用PHP,我如何从$ foo中隔离src属性的内容?我正在寻找的最终结果只会给我" http://example.com/img/image.jpg "
$foo = '<img class="foo bar test" title="test image" src="http://example.com/img/image.jpg" alt="test image" width="100" height="100" />';
Run Code Online (Sandbox Code Playgroud)