Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F1142309
modifiercompiler.count_paragraphs.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
699 B
Subscribers
None
modifiercompiler.count_paragraphs.php
View Options
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_paragraphs modifier plugin
*
* Type: modifier<br>
* Name: count_paragraphs<br>
* Purpose: count the number of paragraphs in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_paragraphs (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function
smarty_modifiercompiler_count_paragraphs
(
$params
,
$compiler
)
{
// count \r or \n characters
return
'(preg_match_all(
\'
#[
\r\n
]+#
\'
, '
.
$params
[
0
]
.
', $tmp)+1)'
;
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Aug 3, 07:41 (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25935
Default Alt Text
modifiercompiler.count_paragraphs.php (699 B)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment