diff options
author | Nathan Lasseter <nathan@4574.co.uk> | 2014-06-07 10:05:49 +0000 |
---|---|---|
committer | Nathan Lasseter <nathan@4574.co.uk> | 2014-06-07 10:05:49 +0000 |
commit | 6d03e10297392a4b8092a7b27258b2b9abc96a16 (patch) | |
tree | e96d482b04fe21da670a5a5b293da3cfd2534bac /functions.php | |
parent | 2042d69d950545dfbe9389cde66e9a35654d5ec3 (diff) |
General refactor to make title and summarise for RSS and tidying
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..ec1ef28 --- /dev/null +++ b/functions.php @@ -0,0 +1,14 @@ +<?php + +function summarise($post) { + $post = preg_replace('/(\r?\n|\t)/', " ", $post); + $post = preg_replace('/"/', """, $post); + $post = preg_replace('/<.*?>/', " ", $post); + return substr($post, 0, 196) . "..."; +} + +function title() { + require("title.php"); +} + +?> |