迷你纺织品类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了迷你纺织品类相关的知识,希望对你有一定的参考价值。
This is a version of Textile that only accepts paragraps, bold, italics, links, and images. Enjoy.
<?php class TextiLite{ /* TextiLite: A lightweight version of Textile built with PHP by Evan Walsh Version 001 Based on the work of: http://codeigniter.com/wiki/BBCode_Helper/ http://codeigniter.com/forums/viewthread/69615/ Supports: <br/> by the way of newline *Text* => <strong>Text</strong> _Text_ => <em>Text</em> !http://image.url! => <img src="http://image.url"/> "Text":http://text.url => <a href="http://text.url" title="Text">Text</a> */ function paragraph($text){ $output = null; foreach($paragraphs as $paragraph) { $output .= " <p>".$paragraph."</p> "; } return $output; } function textile($text = null){ '/(.+) (.+)/', '/*([^*]+)*/', '/\_([^*]+)\_/', '/(!)((?:http|https)(?::\/{2}[\w]+)(?:[\/|\.]?)(?:[^\s"]*))(!)/', '/(")(.*?)(").*?((?:http|https)(?::\/{2}[\w]+)(?:[\/|\.]?)(?:[^\s"]*))/', ); "$1<br/>$2", "<strong>$1</strong>", "<em>$1</em>", "<img src="$2"/>", "<a href="$4" title="$2">$2</a>", ); } function process($text){ $text = $this->paragraph($text); $text = $this->textile($text); return $text; } } ?>
以上是关于迷你纺织品类的主要内容,如果未能解决你的问题,请参考以下文章