CMSからテキストが生成されているため、出力される文字列を制御できません。PHP:二重引用符を置換する
私は二重引用符を単一のものに置き換えるためにあらゆる種類のPHP関数を試しましたが、役に立たないものです。誰もが解決策を提案できますか?
<?php
$comments = str_replace('"', "'", ("6:00 pm , practiced "Zen' flying and sit carving (one leg down) and back carving and sit-to-sit front flip (weight require slower wind speed)");
echo $comments;
?>
エラーメッセージ:
Parse error: syntax error, unexpected 'Zen' (T_STRING) in
テンプレートから完全なコードの追加:
{exp:query
sql="SELECT
t.entry_id,
entry_date,
field_id_4 as tunnel,
field_id_2 as log_time,
field_id_17 as log_video,
field_id_18 as log_comments
FROM exp_channel_data d, exp_channel_titles t
WHERE t.channel_id = 7
AND t.status != 'Delete'
AND author_id = '{embed:member_id}'
AND t.entry_id = d.entry_id
AND field_id_19 = ''
ORDER BY entry_id DESC"
}
<?php
//strip out Playa bumph from our tunnel
$tunnel = substr(strrchr("{tunnel}","]"),2);
preg_match_all("/\[[^\]]*\]/", "{tunnel}", $matches);
$tunnel_id = trim($matches[0][0],'[,]');
$time[] = array(
"entry_id" => "{entry_id}",
"tunnel" => $tunnel,
"tunnel_id" => $tunnel_id,
"entry_date" => "{entry_date}",
"log_time" => "{log_time}",
"log_video" => "{log_video}",
"log_comments" => "{log_comments}");
?>
{/exp:query}
<script>
IBA.logged_time = <?php echo json_encode($time); ?>
</script>
log_commentsは問題です。
コードの書式設定を見てください... – Rizier123