Is easy to visualize the mistake in your JSON encoding analizing the example provided line. There is a pattern , so it can be recovered easilly.
REGEX approach
You can fix your string aplying a 2 stages regexp, the first one to introduce the missing double quotes, and the second, to inject the coma delimiters.
<?php
$str = '{"id_content": "1"name": "Zappos Case Page 1"id_content_type": "1}';
$str = preg_replace( '/"\w+":\s"[\w\s]*/' , '$0"' , $str);
$str = preg_replace( '/""/' , '","' , $str);
echo $str;
?>
STRING MANIPULATION approach
Another approach is by deconstruction, splitting the string, processing the parts, and building the object again:
<?php
$str = '{"id_content": "1"name": "Zappos Case Page 1"id_content_type": "1}';
// remove '{' from the beggining of the string
$str = ltrim($str, '{');
// remove '}' from the end of the string
$str = rtrim($str, '}');
// remove the first '"' from the beggining of the string
$str = ltrim($str, '"');
// split the string in each '"'
$raw = explode('"' , $str);
// prepare an empty array to store valid properties&values
// and store in it the valid keys (removing useless keys ":")
$clean = array();
for ($i = 0; $i < count($raw); $i++) {
if ( trim( $raw[$i] ) !== ":") array_push( $clean,$raw[$i] );
}
// asumming property names are on odd keys
// and values in even keys
// we can now create a valid object...
$obj = array();
for ($i = 0; $i < count($clean); $i++) {
if ( $i % 2 === 0) $obj[ $clean[$i] ] = $clean[$i+1];
}
// and convert it back to JSON notation
$jsonObj = json_encode($obj);
echo $jsonObj;
?>
INPUT (invalid json):
'{"id_content": "1"name": "Zappos Case Page 1"id_content_type": "1}'
OUTPUT (valid json):
'{"id_content":"1","name":"Zappos Case Page 1","id_content_type":"1"}'
This code will only work, if the pattern is always the same. Otherwise, you will have to addapt the code to the different scenarios.