这就是我到现在所做的事情:
<?php
$patterns= '/staff_(?)/';
$replacements= '';
$string = 'staff_name as user_name';
$string2 = 'staff_phone as user_phone';
echo preg_replace($patterns, $replacements, $string)."<br>";
echo preg_replace($patterns, $replacements, $string2);
?>
Run Code Online (Sandbox Code Playgroud)
期望输出是:
"staff_name as user_name"应返回"name"
"staff_phone as user_phone"应该返回"phone"
我很反应原生,我已经编写了登录代码
payload={email:"niju1992@gmail.com",password:"helo123"};
var Options=
{
method: 'POST',
headers: {'Accept': 'application/json','Content-Type': 'application/json'},
body: payload
}
fetch(Conf.API.SIGNIN, Options)
.then((response) =>
{
if (response.status >= 400)
{
throw new Error("Bad response from server");
}
return response.json();
})
.then((responseData) =>
{
//this.setState({data:responseData})
console.log(responseData)
})
.catch((error) => {
console.error("Error:"+error);
})
.done();
Run Code Online (Sandbox Code Playgroud)
但我得到错误
index.android.bundle:19291错误:TypeError:无法读取未定义的属性'bodyUsed'
任何一位专家都可以.有人可以帮忙吗?