CKEDITOR:将单词计数值存储到变量 [英] CKEDITOR : storing wordcount value to a variable

查看:240
本文介绍了CKEDITOR:将单词计数值存储到变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CKEDITOR:如果我通过了textarea的内容,我将有一个表格和一个textarea(已替换为ckeditor)如何获取wordcount值?我在ckeditor中使用wordcount插件。谢谢

CKEDITOR: I have a form and a textarea(replaced to ckeditor) if i pass the content of the textarea how do i get the wordcount value ? i am using the wordcount plugin in ckeditor. thank you

//how do i store the wordcount?
CKEDITOR.replace('textarea', {
  extraPlugins: 'wordcount,justify'
});



//how do i get the wordcount ?
<?=  form_input($title,set_value('title')) . "</br>"; ?>
  <textarea name="textarea" id="text" required></textarea>
  <?= form_close(); ?>

    //in php $text = $this->input->post('textarea'); //$textwordcount = wordcount of the textarea;


推荐答案

也许您可以使用我的把戏

maybe you can use my trick

$text = strip_tags($this->input->post('textarea'));
$words = count(explode(' ',$text));

这篇关于CKEDITOR:将单词计数值存储到变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆