Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
938 views
in Technique[技术] by (71.8m points)

cakephp - php e() and h() functions?

I and lately I'm seeing h() and e() functions in PHP. I have googled them, but they are so short that results don't give any idea of what they are. I got results like exponential or math related functions. For example:

<td><?php echo h($room['Room']['message']) ?></td>

Does anyone have an idea? or maybe they are not called functions? (I think I read about that very long ago, but I can remember its real name)

ADDED:

Thanks, for the replies. I am using CakePHP and also found an e() example:

<?php e($time->niceShort($question['Question'] ['created'])) ?>

If they were escaping somehow strings I think it would make sense, since I always see them right next the "echo"

I still don't know what they are ;(

question from:https://stackoverflow.com/questions/2043072/php-e-and-h-functions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It looks like it might be CakePHP.

See e()

e (mixed $data)

Convenience wrapper for echo().

This has been Deprecated and will be removed in 2.0 version. Use echo() instead.

See h()

h (string $text, string $charset = null)

Convenience wrapper for htmlspecialchars().


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...