file:str-wordwrap.php
url:http://localhost:88/str/str-wordwrap.php
<?php
$text = "This document covers the JavaTM 2 Platform Standard Edition 5.0 Development Kit (JDK 5.0). Its external version number is 5.0 and internal version number is 1.5.0. For information on a feature of the JDK, click on its component in the diagram below.";
echo "Original text:"."<br/>";
echo $text."<br/>";
echo $text."<hr/>";
echo "Destination text(after wrap):"."<br/>";
echo wordwrap($text, 50, "<br/>")."<br/>";
?>
file:str-strreplace.php
url:http://localhost:88/str/str-strreplace.php
<?php
$text = "This document covers the JavaTM 2 Platform Standard Edition 5.0 Development Kit (JDK 5.0). Its external version number is 5.0 and internal version number is 1.5.0. For information on a feature of the JDK, click on its component in the diagram below.";
echo "Original text:"."<br/>";
echo $text."<br/>";
echo "<hr/>";
echo "Destination text(replace):"."<br/>";
echo str_replace(" ", "__", $text)."<br/>";
?>
file:str-explode-implode.php
url:http://localhost:88/str/str-explode-implode.php
<?php
$text = "This document covers the JavaTM 2 Platform Standard Edition 5.0 Development Kit (JDK 5.0). Its external version number is 5.0 and internal version number is 1.5.0. For information on a feature of the JDK, click on its component in the diagram below.";
echo "Original text:"."<br/>";
echo $text."<br/>";
echo "<hr/>";
$sentenses = explode(". ", $text);
echo "Destination text(explode):"."<br/>";
foreach ($sentenses as $sentense){
echo $sentense."<br/>";
}
echo "<hr/>";
$newText= implode($sentenses, ". ");
echo "Destination text(implode):"."<br/>";
echo $newText."<br/>";
?>