bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deprecated ereg type functions
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue Feb 19, 2013 2:36    Post subject: Deprecated ereg type functions Reply with quote

OLD

Code:
    if($this->filebasepath == '') {

       $this->basepath = str_replace("\\","/",$this->urlbasepath); //If on Windows
       $urllevels=substr_count('/',ereg_replace('^.*?://',$this->urlbasepath));
    };
  }

  function setBasePath($str) {
    // legacy implementation
    if(ereg('^(http|https|ftp|file):\\/\\/',$str) ) {


NEW

Code:
   if($this->filebasepath == '') {

      $this->basepath = str_replace("\\","/",$this->urlbasepath); //If on Windows
      $urllevels = substr_count( '/', preg_replace( '/^.*?:\/\//', $this->urlbasepath ) );
   };
  }

  function setBasePath($str) {
    // legacy implementation
if ( preg_match( '/^(http|https|ftp|file):\/\//', $str ) ) {


OLD

Code:
      if(ereg(REGEXP_NOENDTAG, $ltag)) {


NEW

Code:
      if(preg_match(REGEXP_NOENDTAG, $ltag)) {


OLD

Code:
ereg_replace("^/([^/]*/){".$this->urllevels."}",'',$path);


NEW

Code:
preg_replace("#^/([^/]*/){".$this->urllevels."}#",'',$path);


OLD

Code:
        if(!isset($attr['MEDIA']) or ereg('print',$attr['MEDIA'])) {


NEW

Code:
        if(!isset($attr['MEDIA']) or strstr($attr['MEDIA'], 'print')) {


OLD

Code:
        $poster_from = ereg_replace(".gif", "", $poster_from);


NEW

Code:


        $poster_from = str_replace(".gif", "", $poster_from);


OLD

Code:
   if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {


NEW

Code:
   if (!preg_match('#^\[?[0-9\.]+\]?$#', $email_array[1])) {
  
Back to top
View user's profile Send private message Visit poster's website
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue Feb 19, 2013 2:56    Post subject: Reply with quote

OLD

Code:
         ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $getdate);


NEW

Code:
         preg_match('#([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $time, $getdate);


OLD

Code:
   $new_text = ereg_replace('  +', ' ', $new_text); // remove double spaces.


NEW

Code:
   $new_text = preg_replace('#  +#', ' ', $new_text); // Remove anything greater than one space.


OLD

Code:


   $server_port = (!ereg('^([0-9]{1,6})', $_SERVER['REMOTE_PORT'])) ? '' : $_SERVER['REMOTE_PORT'];


NEW

Code:
   $server_port = (!preg_match('#^([0-9]{1,6})#', $_SERVER['REMOTE_PORT'])) ? '' : $_SERVER['REMOTE_PORT'];
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©