source: branches/0.4/web/addons/job_monarch/dwoo/plugins/builtin/functions/count_paragraphs.php @ 755

Last change on this file since 755 was 755, checked in by ramonb, 11 years ago
  • add Dwoo
File size: 699 bytes
Line 
1<?php
2
3/**
4 * Counts the paragraphs in a string
5 * <pre>
6 *  * value : the string to process
7 * </pre>
8 * This software is provided 'as-is', without any express or implied warranty.
9 * In no event will the authors be held liable for any damages arising from the use of this software.
10 *
11 * @author     Jordi Boggiano <j.boggiano@seld.be>
12 * @copyright  Copyright (c) 2008, Jordi Boggiano
13 * @license    http://dwoo.org/LICENSE   Modified BSD License
14 * @link       http://dwoo.org/
15 * @version    1.0.0
16 * @date       2008-10-23
17 * @package    Dwoo
18 */
19function Dwoo_Plugin_count_paragraphs_compile(Dwoo_Compiler $compiler, $value)
20{
21        return '(preg_match_all(\'#[\r\n]+#\', '.$value.', $tmp)+1)';
22}
Note: See TracBrowser for help on using the repository browser.