codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $string = "|1|2|3|4|"; $string = substr($string,1,-1); $array = explode("|", $string); foreach ($array as $part) { echo $part."-"; } echo PHP_EOL ; /* or use implode to joib */ echo implode("-",$array); ?>
Private
[
?
]
Run code
Submit