[ create a new paste ] login | about

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

PHP, pasted on Sep 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$str = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem     Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown     printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum";
$str = explode(' ', $str);
$substr = "";

foreach ($str as $cur) {
    if (strlen($substr) >= 125) {
        break;
    }
    $substr .= $cur . ' ';
}
echo $substr;
?>


Output:
1
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem     Ipsum has been the industry's standard dummy 


Create a new paste based on this one


Comments: