<?php
function var_request($lmode, $default){ 
    if(isset($_GET[$lmode])){ 
        $default = $_GET[$lmode];
    } 
    if(isset($_POST[$lmode])) { 
        $default = $_POST[$lmode];
    } 
    return $default;
   }
   
   function redirect_to($url)
   {  
      header('Location:'.$url);
      exit;
   } 
   function str_substr($start, $end, $str) 
   {      
     $temp = explode($start, $str, 2);      
     $content = explode($end, $temp[1], 2);      
     return $content[0];
   }
   function get_word($gws,$start,$end){
 	   $stle=strpos($gws,$start);
 	   $stle=$stle+strlen($start);
 	   $sten=strpos($gws,$end,$stle);
 	   $stlength=$sten-$stle;
 	   return mb_substr($gws,$stle,$stlength);
   }
    function get_pic($gwss,$starts,$ends){
 	   $stles=strpos($gwss,$starts);
 	   if($stles==false)
 	      return "";
 	   $stles=$stles+strlen($starts);
 	   $stens=strpos($gwss,$ends,$stles);
 	   if($stens==false)
 	      $stens=strlen($gwss);
 	   $stlengths=$stens-$stles;
 	   return mb_substr($gwss,$stles,$stlengths);
   }
?>