'What is the best use of php htmlentities() function while I have double and single quote in my string?

Please consider the following examples:

{assign var="title_short" value="\"Think win-win.\" - A quote by whom? » MCQ Academy"}

Example 1:

<a title="{$title_short|htmlentities}" href="{$story_url}">{$title_short|htmlentities}</a>

Example 2:

<a title="{$title_short|htmlentities}" href="{$story_url}">{$title_short}</a>

Which use of htmlentities() function should I follow when I have double and/or single quote in my string?

php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source