I want to parsing this code with php echo :
<li><a onclick="resource('showvideo',<?= $myvideo->id?>);"> <i class="fa fa-file-video-o"></i> {{$myvideo->title}}</a></li>
but results get to this code :
<li><a onclick="resource(' showvideo',44);"> <i class="fa fa-file-video-o"></i> test</a></li>
I have a new blank space before showvideo in resource parameters! my php echo :
echo "html +="."'<li><a onclick=\"resource(\"showvideo\",44);\"><i class=\"fa fa-file-video-o\"></i> sdfdsf</a></li>'";
I try so much to clear this blank space but I failed. please help me
Try this
echo "html +="."'<li><a onclick='resource("showvideo",44);\'><i class=\"fa fa-file-video-o\"></i> sdfdsf</a></li>'";
And you were getting spaces due to improper use of quotes in your string.
Hope it helps!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.