如何在PHP中创建和获取Java中的关联数组?
例如:
$arr[0]['name'] = 'demo';
$arr[0]['fname'] = 'fdemo';
$arr[1]['name'] = 'test';
$arr[1]['fname'] = 'fname';
Run Code Online (Sandbox Code Playgroud) 有字符串strng = "<title>text1</title><title>text2</title>";
如何获取数组
arr[0] = "text1";
arr[1] = "text2";
Run Code Online (Sandbox Code Playgroud)
我尝试使用它,但结果有,而不是数组 text1</title><title>text2
Pattern pattern = Pattern.compile("<title>(.*)</title>");
Matcher matcher = pattern.matcher(strng);
matcher.matches();
Run Code Online (Sandbox Code Playgroud)