[ create a new paste ] login | about

Link: http://codepad.org/l1Fv0YJ8    [ raw code | output | fork ]

PHP, pasted on Jun 8:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
$tags = 'teste teste2 teste3';
$tag = explode(' ',$tags);
echo $tag[0];
echo '<br>';
echo $tag[1];
echo '<br>';
echo $tag[2];

echo '<br>';
echo '<br>';

$tags = 'teste,teste2,teste3';
$tag = preg_split("/[,]+/",$tags);
echo $tag[0];
echo '<br>';
echo $tag[1];
echo '<br>';
echo $tag[2];
?>


Output:
1
teste<br>teste2<br>teste3<br><br>teste<br>teste2<br>teste3


Create a new paste based on this one


Comments: