Home >Backend Development >PHP Tutorial >php关键字瓜分

php关键字瓜分

WBOY
WBOYOriginal
2016-06-13 10:31:52853browse

php关键字分割

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$old_guanjianzi=我,的,php;标签:<a href="tag.php?so=<?php" foreach as urlencode>><?php echo $v;?></a>


这样分割关键字后只能显示一个关键字。怎么三个关键字用空格分割,每个关键字一个链接。

------解决方案--------------------
PHP code
$old_guanjianzi= "我,的,php";$ar = explode(',', $old_guanjianzi);foreach($ar as $v) echo "<a href="tag.php?so=%7B%24v%7D">{$v}</a> ";<br><font color="#e78608">------解决方案--------------------</font><br>
探讨

PHP code
$old_guanjianzi= "我,的,php";
$ar = explode(',', $old_guanjianzi);
foreach($ar as $v) echo "{$v} ";

------解决方案--------------------
PHP code
echo "<a href="tag.php?so=%22.urlencode(%24v).%22">{$v}</a> ";?><div class="clear">
                 
              
              
        
            </div>
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