Questions about how to tease people

Source: Internet
Author: User
You don't need to pay attention to the garbled text of funny questions. & lt ;! DOCTYPE & nbsp; HTML & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; HTML & nbsp; 4.01 & nbsp; TransitionalEN & nbsp; www. w3.orgTRhtml4loose. dtd & gt; & lt; html & gt; & nbsp; & funny question
No need to pay attention to garbled places



New Document









5. it will feel and be internationalized.





Function m_substr ($ str, $ start, $ length ){
$ Str_length = $ start + $ length;
$ Tmp_str = "";
For ($ I = 0; $ I <$ str_length; $ I ++ ){
If (ord (substr ($ str, $ I, 1) = 0x0a ){
$ Tmp_str. ='
';
}
If (ord (substr ($ str, $ I, 1)> 0xa0 ){
$ Tmp_str. = substr ($ str, $ I, 2 );
$ I ++;
}
Else {
$ Tmp_str. = substr ($ str, $ I, 1 );
}
}
Return $ tmp_str;
}
If (isset ($ _ GET ['Page']) {
$ Page = $ _ GET ['Page'];
} Else {
$ Page = 1;
}
$ Counter = file_get_contents ("example.txt ");
$ Length = strlen ($ counter );
$ Page_count = ceil ($ length/400 );
$ Str = m_substr ($ counter, 0, ($ page-1) * 400 );
$ Str1 = m_substr ($ counter, 0, $ page * 400 );
Echo substr ($ str1, strlen ($ str), strlen ($ str1)-strlen ($ str ));
?>




Echo "Asad? : ". $ Page."/". $ page_count ."";
Echo "excuse me? ";
If ($ page> 1 ){
Echo "bike ?? ";
}
If ($ page <$ page_count ){
Echo "location ?? ";
}
Echo "β? ";
?>



?





I am copying textbooks now... I know this is a bad habit. But I won't write it, and I can't just use this 2b method. I would like to ask if there is any way to separate the html and php code? How can I create this file? I don't want to use template engines like smarty, because I don't actually do it ~ I only use introduction ..

Share: More


------ Solution --------------------
Use a framework ..
------ Solution --------------------
 function m_substr($str,$start,$length){
$str_length=$start+$length;
$tmp_str="";
for($i=0;$i<$str_length;$i++){
if(ord(substr($str,$i,1))==0x0a){
$tmp_str.='
';
}
if(ord(substr($str,$i,1))>0xa0){
$tmp_str.=substr($str,$i,2);
$i++;
}
else{
$tmp_str.=substr($str,$i,1);
}
}
return $tmp_str;
}
if(isset($_GET['page'])){
$page=$_GET['page'];
}else{
$page=1;
}
$counter=file_get_contents("example.txt");
$length=strlen($counter);
$page_count=ceil($length/400);
$str=m_substr($counter,0,($page-1)*400);
$str1=m_substr($counter,0,$page*400);
$text = substr($str1,strlen($str),strlen($str1)-strlen($str));
include 'tpl.html';
?>


Tpl.html



New Document









5. it will feel and be internationalized.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.