Re: removing text from a string

From: Date: Tue, 04 Nov 2008 14:23:48 +0000
Subject: Re: removing text from a string
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-282847@lists.php.net to get a copy of this message
<?php $filename = ".htaccess"; $fp =@ fopen($filename, "r") or die ("Couldn't open $filename"); // ENTER ENCODING HERE .. $encoding = 'UTF-8'; if ($fp) { while (!feof($fp)) { $thedata =@ fgets($fp); // if every number is defonoodle separated by a dot .. if (is_string($thedata)) { $position_of_dot = mb_strpos($thedata, '.', 0, $encoding); if (is_numeric($position_of_dot) && ($position_of_dot >= 0)) $thedata = trim(mb_substr($thedata, $position_of_dot, mb_strlen($thedata, $encoding), $encoding)); } //print the modified line and \n } } @fclose($fp); ?> [mb_strpos] http://in.php.net/manual/en/function.mb-strpos.php [mb_substr] http://in.php.net/manual/en/function.mb-substr.php //A yeti

« previous php.general (#282847) next »