Home >Backend Development >PHP Tutorial >小白提问 将数组中的元素是字符串的元素输出到P标签内 如何写呢

小白提问 将数组中的元素是字符串的元素输出到P标签内 如何写呢

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:21:491207browse

小白提问 将数组中的元素是字符串的元素输出到P标签内 怎么写呢
小白提问 将数组中的元素是字符串的元素输出到P标签内 怎么写呢
------解决思路----------------------

<br /><?php<br />$arr = array(1,'a','b','1','2',3,4,5);<br /><br />foreach($arr as $v){<br />    if(gettype($v)=='string'){<br />        echo '<p>'.$v.'</p>';<br />    }<br />}<br />?><br />

a
b
1
2

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn