Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json_encode escape

<?php
/*
 * Escaping the reverse-solidus character ("/", slash) is optional in JSON.
 *
 * This can be controlled with the JSON_UNESCAPED_SLASHES flag constant in PHP.
 *
 * @link http://stackoverflow.com/a/10210433/367456
 */    
$url = 'http://www.example.com/';

echo json_encode($url), "
";

echo json_encode($url, JSON_UNESCAPED_SLASHES), "
";
 
PREVIOUS NEXT
Tagged: #escape
ADD COMMENT
Topic
Name
5+7 =