作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个文本区域,其中包含以下信息,
Secured places in the national squad respectively
Selected to the national team this year as well
Selected to the national team twice during his university career
Went to school at ABS
当用户单击提交按钮时,我想将每行中的字符串获取到提交页面中的 php 变量,如下所示
$a = "Secured places in the national squad respectively";
$b = "Selected to the national team this year as well";
$c = "Selected to the national team twice during his university career";
$d = "Went to school at ABS";
谁能告诉我该怎么做?
最佳答案
如果您不关心句子而是换行符,那么您应该能够基于它来分成数组,如下所示:
$posted_text = $_POST['text']; // or however you get the value into a string
$text_array = explode(PHP_EOL, $posted_text);
关于php - 如何在html文本区域中逐句获取字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12063024/
我是一名优秀的程序员,十分优秀!