[ create a new paste ] login | about

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

connermcd - PHP, pasted on Jul 21:
1
2
3
4
5
6
7
8
9
<?php
$input_string = "It is a wonderful goodbye letter that ultimately had a happy ending.";
$array = explode(" ", substr($input_string,0,-1));
array_push($array, "-");
for($i=0;$i<4;$i++)
   array_unshift($array, array_pop($array));
$output_string = ucfirst(implode(" ", $array)) . ".";
print_r($output_string);
?>


Output:
1
A happy ending - It is a wonderful goodbye letter that ultimately had.


Create a new paste based on this one


Comments: