首页 > 编程知识 正文

java数组转json字符串,java需要转义的字符

时间:2023-05-05 15:25:39 阅读:24136 作者:3365

ihavealinkthatissentthrowsomephp :

echo 'voir sa galerie ';

$galerry links to another page。

get_title($primid ) istheidofaspecificelementin $ galerry page。

andthemechanismworksfineuntiloneoftheelementsidhasasinglequoteinit.whichmakessenseasitwouldinterrupttheeechofunction。

thisiswhyihavetheapastrofunction :

functionAPastro($phrase ) {

$phrase1=str_replace ()优质啤酒、''、$phrase );

return $phrase1;

}

yet thebeforethesinglequoteisn ' t helping .

soletssaythelinkredirectstotheelementwithid=' l ' aro ' onthepagesomething.PHP

thentheurlwillbesomething.PHP # l淡笔/pitwouldinterrupttheechofunction

itwouldn ' t.itwouldbreakastringliteraldelimitedby ' characters,butyourstringliteralisdelimitedwith ' characters.in

useurlencodetomakeastringsafetoputintoaurl。

usehtmlspecialcharstomakeastringsafetoputintoanhtmlattribute。

$title=get_title($primid );

$ URL safe _ title=urlencode ($ title;

$ URL=$ galerry.' # '.$ URL safe _ title;

$ html safe _ URL=htmlspecialchars ($ URL,kkdxbcQUOTES | kkdxbcHTML5);

echo 'voir sa galerie ';

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。