protected static function getCode($file, $offset, $limit, $pos) {
		ob_start();
		highlight_string(file_get_contents($file));
		$code = ob_get_contents();
		ob_end_clean();
		$code = explode('<br />', $code);
		$code = array_slice($code, $offset, $limit);

		if($code) {
			$r = '<div><span class="toggle"><span>+</span>Code:</span>'."<br>\n";
			$r .= '<div style="display:none"><code>';
			foreach($code as $k=>$line) {
				if($pos == $k+1) {
					$r .= '<span style="float:left; display:inline-block; width:50px; color:#000">'.($offset+$k+1).'</span>
					<div class="current_line" style="display:inline-block; background-color:#ccc;">'.$line.'</div><br>';
				}
				else
					$r .= '<span style="float:left; display:inline-block; width:50px; color:#000">'.($offset+$k+1).'</span>'.$line.'<br>';
			}
			$r .= '</code></div></div>';
			return $r;
		}
	}
protected static function getCode($file, $offset, $limit, $pos) {
		ob_start();
		highlight_string(file_get_contents($file));
		$code = ob_get_contents();
		ob_end_clean();
		$code = explode('<br />', $code);
		$code = array_slice($code, $offset, $limit);

		if($code) {
			$r = '<div><span class="toggle"><span>+</span>Code:</span>'."<br>\n";
			$r .= '<div style="display:none"><code>';
			foreach($code as $k=>$line) {
				if($pos == $k+1) {
					$r .= '<span style="float:left; display:inline-block; width:50px; color:#000">'.($offset+$k+1).'</span>
					<div class="current_line" style="display:inline-block; background-color:#ccc;">'.$line.'</div><br>';
				}
				else
					$r .= '<span style="float:left; display:inline-block; width:50px; color:#000">'.($offset+$k+1).'</span>'.$line.'<br>';
			}
			$r .= '</code></div></div>';
			return $r;
		}
	}
protected static function getCode ( $ file , $ offset , $ limit , $ pos ) { ob_start ( ) ; highlight_string ( file_get_contents ( $ file ) ) ; $ code = ob_get_contents ( ) ; ob_end_clean ( ) ; $ code = explode ( '<br />' , $ code ) ; $ code = array_slice ( $ code , $ offset , $ limit ) ; if ( $ code ) { $ r = '<div><span class="toggle"><span>+</span>Code:</span>' . "<br>\n" ; $ r .= '<div style="display:none"><code>' ; foreach ( $ code as $ k => $ line ) { if ( $ pos == $ k + 1 ) { $ r .= '<span style="float:left; display:inline-block; width:50px; color:#000">' . ( $ offset + $ k + 1 ) . '</span>
					<div class="current_line" style="display:inline-block; background-color:#ccc;">' . $ line . '</div><br>' ; } else $ r .= '<span style="float:left; display:inline-block; width:50px; color:#000">' . ( $ offset + $ k + 1 ) . '</span>' . $ line . '<br>' ; } $ r .= '</code></div></div>' ; return $ r ; } }
Return the code extract.
@param  string  $file   file path
@param  integer $offset from line
@param  integer $limit  number of lines
@param  integer $pos    line position
@return string
Return the code extract .