note 98204 added to function.wordwrap

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
main version function a 'wordwrap'

/*
		* @param int $ile_lini
		* @param int $le_znakow_w_lini
		* $param str $ogonek
		* $param str $text
		 */
		public static function _wordwrap($ile_linii, $ile_znakow_w_lini, $ogonek, $text)
		{
			$dlugosc = strlen($text);
			$text = wordwrap($text, $ile_znakow_w_lini, "\n", true);
			if($dlugosc > $ile_znakow_w_lini)
			{
				$text_A = explode("\n", $text);
				$new_text = '';
				for($i=0;$i<$ile_linii;$i++)
				{
					$new_text .= "\n" . $text_A[$i];
				}
				$dlugosc_ostatniego_ciagu = strlen($text_A[$ile_linii-1]);
				if($dlugosc_ostatniego_ciagu<=$ile_znakow_w_lini-3)
				{
					if($dlugosc > $ile_linii*$ile_znakow_w_lini)
					{
						$new_text = $new_text.'...';
					}
					elseif($text_A[$ile_linii] != '')
					{
						$new_text = $new_text.'...';
					}
				}
				else
				{
					$dlugosc > $ile_linii*$ile_znakow_w_lini ? $new_text = substr($new_text, 0, -3).'...' : '';
				}
			}
			return $new_text;
		}
----
Server IP: 69.147.83.197
Probable Submitter: 83.11.195.220
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit        -- https://master.php.net/note/edit/98204
Del: integrated  -- https://master.php.net/note/delete/98204/integrated
Del: useless     -- https://master.php.net/note/delete/98204/useless
Del: bad code    -- https://master.php.net/note/delete/98204/bad+code
Del: spam        -- https://master.php.net/note/delete/98204/spam
Del: non-english -- https://master.php.net/note/delete/98204/non-english
Del: in docs     -- https://master.php.net/note/delete/98204/in+docs
Del: other reasons-- https://master.php.net/note/delete/98204
Reject      -- https://master.php.net/note/reject/98204
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.