= 0) && (!$found);$i--) { $char = $haystack[$i]; if ($char == $needle) $found = 1; else $data .= $char; } return strrev($data); } // Wraps text at $wrap characters function wordWrap($passed, $wrap) { $words = explode(" ", trim($passed)); $i = 0; $line_len = strlen($words[$i])+1; $line = ""; while ($i < count($words)) { while ($line_len < $wrap) { $line = "$line$words[$i] "; $i++; $line_len = $line_len + strlen($words[$i])+1; } if ($i < count($words)) // don't
the last line $line = "$line
"; $line_len = strlen($words[$i])+1; } return $line; } ?>