这就是我想要做的我在一个页面中有3个表单,我需要因为一个表单在模态对话框中打开,我希望在用户单击一个按钮时提交所有3个表单,我也想表单提交中的sucess en error函数的ajax实现
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<script>
var firstFormData = $("#form1").serialize();
var secondFormData = $("#form2").serialize();
var thirdFormData = $("#form3").serialize();
$.post(
URL: test.php
firstFormData + secondFormData + thirdFormData
);
</script>
<form id="form1">
<input type="text" name="one"></input>
</form>
<form id="form2">
<input type="text" name="two"></input>
</form>
<form id="form3">
<input type="text" name="three"></input>
</form>
<button>submit here</button>
<?php
echo $_POST['one'];
echo $_POST['two'];
echo $_POST['three'];
?>
Run Code Online (Sandbox Code Playgroud) 如何使用fa图标在图标内添加文本?
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<i class="fa fa-circle-o" aria-hidden="true">1</i> Run Code Online (Sandbox Code Playgroud)
如何在图标内添加数字1?
我正在尝试使用 php 将表情符号转换为 unicode ,更多信息:https://unicode.org/emoji/charts/full-emoji-list.html
如何U+1F603用php将其转换成这样?
function convert_emoji($var){
}
Run Code Online (Sandbox Code Playgroud) 我有此功能来识别和转换标签,表情符号等
function convert_text($str) {
$regex = "/[@#](\w+)/";
//type and links
$hrefs = [
'#' => 'hashtag.php?hashtag',
'@' => 'user.php?user'
];
$result = preg_replace_callback($regex, function($matches) use ($hrefs) {
return sprintf(
'<a href="%s=%s">%s</a>',
$hrefs[$matches[0][0]],
$matches[1],
$matches[0]
);
}, $str);
//$result = preg_replace("/U\+([A-F0-9]{5})/", '\u{${1}}', $result);
$result = preg_replace('/U\+([A-F0-9]{5})/', '<span style="font-size:30px;">&#x\\1;</span>', $result);
return ($result);
}
Run Code Online (Sandbox Code Playgroud)
我想,使其认识http://并https://从文字和比转换为:
<a href="http://link.com">http://link.com</a>
如何在函数内部实现呢?
$userinfo在php函数中访问具有相同名称的数组
<?php
$userinfo['name'] = "bob";
$userinfo['lastname'] = "johnson";
function displayinfo() {
//not working
echo $userinfo['name']
//global also not working
echo global $userinfo['lastname'];
}
displayinfo();
?>
Run Code Online (Sandbox Code Playgroud)
$userinfo由于变量名称中有多个数组,如何在var中访问数组?
echo $userinfo['name']
//global also not working
echo global $userinfo['lastname'];
Run Code Online (Sandbox Code Playgroud)
两者都不起作用。