PHP code example of sebastiansulinski / smart-quotes
1. Go to this page and download the library: Download sebastiansulinski/smart-quotes library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sebastiansulinski / smart-quotes example snippets
use SSD\SmartQuotes\Utf8CharacterSet;
use SSD\SmartQuotes\Factory as SmartQuotesFactory;
$string = "“Contrary to ‘popular belief’, Lorem Ipsum is not simply ‘random text’. The cost in Sterling is £20.00”";
// UTF-8 implementation
echo SmartQuotesFactory::filter(new Utf8CharacterSet, $string);
// ASCII implementation
echo SmartQuotesFactory::filter(new AsciiCharacterSet, $string);
// both return:
// "Contrary to 'popular belief', Lorem Ipsum is not simply 'random text'. The cost in Sterling is £20.00"