Created
December 8, 2015 07:13
-
-
Save Aziz-Rahman/7c0a48d720025d55b30a to your computer and use it in GitHub Desktop.
Memisahkan kata dengan koma
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1. | |
$text = '#ccc#ddd#fff'; // output awal | |
$data = str_replace ("#", ",#", $text); | |
$str = trim($data,','); | |
echo $str; | |
echo '<br>'; | |
// 2. | |
$test2 = array( '#ccc', '#ddd', '#fff' ); // output awal dg array | |
$result2 = implode( ',', $test2 ); | |
echo $result2; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment