• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP eregi_replace函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中eregi_replace函数的典型用法代码示例。如果您正苦于以下问题:PHP eregi_replace函数的具体用法?PHP eregi_replace怎么用?PHP eregi_replace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了eregi_replace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: kdmail

 function kdmail($f)
 {
     $this->load('lib/phpmailer/class.phpmailer');
     $mail = new PHPMailer();
     //$body             = $mail->getFile(ROOT.'index.php');
     //$body             = eregi_replace("[\]",'',$body);
     $mail->IsSendmail();
     // telling the class to use SendMail transport
     $mail->From = $f["from"];
     $mail->FromName = either($f["fromname"], "noticer");
     $mail->Subject = either($f["subject"], "hello");
     //$mail->AltBody = either($f["altbody"], "To view the message, please use an HTML compatible email viewer!"); // optional, comment out and test
     $mail->AltBody = either($f["msg"], "To view the message, please use an HTML compatible email viewer!");
     // optional, comment out and test
     if ($f["embedimg"]) {
         foreach ($f["embedimg"] as $i) {
             //$mail->AddEmbeddedImage(ROOT."public/images/logo7.png","logo","logo7.png");
             $mail->AddEmbeddedImage($i[0], $i[1], $i[2]);
         }
     }
     if ($f["msgfile"]) {
         $body = $mail->getFile($f["msgfile"]);
         $body = eregi_replace("[\\]", '', $body);
         if ($f["type"] == "text") {
             $mail->IsHTML(false);
             $mail->Body = $body;
         } else {
             $mail->MsgHTML($body);
             //."<br><img src= \"cid:logo\">");
         }
     } else {
         if ($f["type"] == "text") {
             $mail->IsHTML(false);
             $mail->Body = $f["msg"];
         } else {
             $mail->MsgHTML($f["msg"]);
             //."<br><img src= \"cid:logo\">");
         }
     }
     if (preg_match('/\\,/', $f["to"])) {
         $emails = explode(",", $f["to"]);
         foreach ($emails as $i) {
             $mail->AddAddress($i, $f["toname"]);
         }
     } else {
         $mail->AddAddress($f["to"], $f["toname"]);
     }
     $mail->AddBCC($this->config["site"]["mail"], "bcc");
     if ($f["files"]) {
         foreach ($f["files"] as $i) {
             $mail->AddAttachment($i);
             // attachment
         }
     }
     if (!$mail->Send()) {
         return "Mailer Error: " . $mail->ErrorInfo;
     } else {
         return "Message sent!";
     }
 }
开发者ID:tranngocthang89,项目名称:basephpmvc,代码行数:60,代码来源:application.php


示例2: makeURL

function makeURL($URL)
{
    $URL = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:\\+.~#?&//=]+)', '<a href=\\1>\\1</a>', $URL);
    $URL = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:\\+.~#?&//=]+)', '<a href=\\1>\\1</a>', $URL);
    $URL = eregi_replace('([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})', '<a href=\\1>\\1</a>', $URL);
    return $URL;
}
开发者ID:elizabethcb,项目名称:Daily-Globe,代码行数:7,代码来源:twitter-search.php


示例3: CLT

function CLT($text)
{
    //convertir url en titre le plus proche
    $text = trim(Str_ireplace(array('c.html', '/Q.', 'p.html', '.sh', "frontalier74", "frontaliers", "creditimmo", "a74", "s74", "xzxzx", "index", "2007", "_vd", "z/", "y/", "http://", ".fr/"), '', $text), '&? ');
    $text = Preg_replace("~\\.(shtml|html|php|php5)\$~is", '', $text);
    $text = Preg_replace("~^/?s\\.~is", '', $text);
    $text = trim(Preg_Replace("~\\.((ch|co|com|fr|org|biz|info)/?|(shtml|html|htm|php|fla|jpg|bg|K)\$)~", ' ', $text));
    $text = Str_ireplace(array('%E0', "%e0", 'à'), 'a', $text);
    #,"f.","a."
    $text = Str_ireplace(array("1rachat-credit", "portail-patrimoine"), 'rachat de credit', $text);
    $text = eregi_replace("(c|p)?.html", '', $text);
    $text = ereg_replace("_([0-9]+)|^([0-9]+)-|-([0-9]+)|\\.([0-9]+)|\\/([0-9]+)|htm.\$", "", $text);
    //Les nombes en trop en paramètres ..
    $text = ucfirst(trim(str_replace(array("%20", "-", "_", "/", ".", ",", '|'), " ", $text)));
    #ore processing factory
    $pos = strpos($text, '?', 0);
    if ($pos > 0) {
        Preg_match_all("~=([^&]+)~is", $text, $t);
        $text = substr($text, 0, $pos);
        if ($t) {
            $t = $t[1];
            $text .= implode(' ', $t);
        }
    }
    return $text;
    //Supprimer le Get de merde, non, en aucun cas, on le conserve
}
开发者ID:Ben749,项目名称:racetrack,代码行数:27,代码来源:fundev1.php


示例4: OpenTag

 /** returnes true if $p_tag is a "<open tag>"
 		@param 	$p_tag - tag string
                 $p_array - tag array;
         @return true/false
 	*/
 function OpenTag($p_tag, $p_array)
 {
     $aTAGS =& $this->aTAGS;
     $aHREF =& $this->aHREF;
     $maxElem =& $this->iTagMaxElem;
     if (!eregi("^<([a-zA-Z1-9]{1,{$maxElem}}) *(.*)>\$", $p_tag, $reg)) {
         return false;
     }
     $p_tag = $reg[1];
     $sHREF = array();
     if (isset($reg[2])) {
         preg_match_all("|([^ ]*)=[\"'](.*)[\"']|U", $reg[2], $out, PREG_PATTERN_ORDER);
         for ($i = 0; $i < count($out[0]); $i++) {
             $out[2][$i] = eregi_replace("(\"|')", "", $out[2][$i]);
             array_push($sHREF, array($out[1][$i], $out[2][$i]));
         }
     }
     if (in_array($p_tag, $aTAGS)) {
         return false;
     }
     //tag already opened
     if (in_array("</{$p_tag}>", $p_array)) {
         array_push($aTAGS, $p_tag);
         array_push($aHREF, $sHREF);
         return true;
     }
     return false;
 }
开发者ID:tavo1981,项目名称:phpbar,代码行数:33,代码来源:class.string_tags.php


示例5: encode_blast_email

 function encode_blast_email($htmlmessage = NULL, $textmessage = NULL, $message_ID, $fields = NULL)
 {
     if ($this->type != 'Email-Admin') {
         if ($htmlmessage) {
             $htmlmessage = eregi_replace("\\[USERID\\]", $message_ID, $htmlmessage);
             if ($fields) {
                 $htmlmessage = merge_fields_email($htmlmessage, $message_ID, $fields);
             }
             $htmlmessage .= '<img src="' . $Web_Site . 'http://localhost/amp/ut.php?m=' . $message_ID . '" width="1" height="1" border="0">';
             $htmlmessage .= '<br><p align="center"> To unsubscribe please click <a href="' . $Web_Site . 'http://localhost/amp/unsubscribe.php?m=' . $message_ID . '">here</a></p>';
             $htmlmessage = ereg_replace("\\[[A-Z\\. ]+\\]", "", $htmlmessage);
         }
         if ($textmessage) {
             //$textmessage = eregi_replace("\[USERID\]",$message_ID,$textmessage,$fields=NULL);
             if ($fields) {
                 $textmessage = $this->merge_fields_email($textmessage, $message_ID, $fields);
             }
             $textmessage .= '\\n_____________________________________________________\\n To unsubscribe go to:\\n ' . $Web_Site . '/unsubscribe.php?m=' . $message_ID;
             $textmessage = ereg_replace("\\[[A-Z\\. ]+\\]", "", $textmessage);
         }
     } else {
         if ($htmlmessage) {
             if ($fields) {
                 $htmlmessage = merge_fields_email($htmlmessage, $message_ID, $fields);
             }
             $htmlmessage .= '<img src="' . AMP_SITE_URL . '/ut.php?m=' . $message_ID . '" width="1" height="1" border="0">';
             $htmlmessage = ereg_replace("\\[[A-Z\\. ]+\\]", "", $htmlmessage);
         }
     }
     $message = array('html' => $htmlmessage, 'text' => $textmessage);
     return $message;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:32,代码来源:EmailBlast.php


示例6: postProcessForm

 public function postProcessForm(&$v, &$fb, &$obj)
 {
     $defs = $obj->_getPluginsDef();
     $field = $obj->fb_elementNamePrefix . 'filename' . $obj->fb_elementNamePostfix;
     if (!$_FILES[$field]['tmp_name']) {
         return;
     }
     $filename = $obj->getImageName();
     if (!$filename) {
         $filename = $obj->getOwner()->tableName() . '_' . substr(md5(time() + rand(0, 100)), 0, 10);
     }
     $obj->filename = $this->_upFile($obj, $obj->fb_elementNamePrefix . 'filename' . $obj->fb_elementNamePostfix, $defs['otfimage']['path'], $filename);
     $obj->update();
     /**
      * Clearing cache for this image
      **/
     $filename = eregi_replace('(\\.[^\\.]+)$', '', basename($obj->filename));
     $cachefolder = APP_ROOT . 'public/' . $defs['otfimage']['cache'] . '/' . $filename . '/';
     foreach (FileUtils::getAllFiles($cachefolder) as $file) {
         @unlink($file);
     }
     /**
      * Setting as main if none exist
      */
     $main = $obj->getOwner();
     $mainImg = $main->getMainImage();
     if (!$obj->ismain && !$mainImg->pk()) {
         $obj->setAsMain();
     }
 }
开发者ID:demental,项目名称:m,代码行数:30,代码来源:db.php


示例7: get_news

function get_news()
{
    global $DISABLE_NEWS_GETTER;
    if ($DISABLE_NEWS_GETTER == 1) {
        return "nonews";
    }
    $news = @file("http://x7chat.com/rss/x7cu.rss");
    $news = @implode("", $news);
    $news = preg_split("/<news>/", $news);
    @array_shift($news);
    $newsnum = 0;
    $return = array();
    foreach ($news as $Key => $val) {
        $i++;
        $val = eregi_replace("_;", "&#59", $val);
        $val = explode(";", $val);
        $return[$newsnum]['title'] = $val[0];
        $return[$newsnum]['author'] = $val[1];
        $return[$newsnum]['date'] = $val[2];
        $return[$newsnum]['icon'] = $val[3];
        $return[$newsnum]['body'] = $val[4];
        if ($i > 2) {
            break;
        }
        $newsnum++;
    }
    if (count($return) == 0) {
        $return = "nonews";
    }
    return $return;
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:x7cread.php


示例8: formatUrlsInText

function formatUrlsInText($text)
{
    //$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
    $reg_exUrl = "(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)";
    if (preg_match_all($reg_exUrl, $text, $matches)) {
        preg_match_all($reg_exUrl, $text, $matches);
        $usedPatterns = array();
        foreach ($matches[0] as $pattern) {
            if (!array_key_exists($pattern, $usedPatterns)) {
                $usedPatterns[$pattern] = true;
                //$text = str_replace($pattern, "<a class=userContent href='".$pattern."' target='_blank'>".$pattern."</a>", $text);
                $text = eregi_replace($pattern, "<a class=userContent href='" . $pattern . "' target='_blank'>" . $pattern . "</a>", $text);
            }
        }
        echo nl2br($text);
        //return $text;
    } else {
        $reg_exUrl = "/(^|[^\\/])([a-zA-Z0-9\\-\\_]+\\.[\\S]+(\\b|\$))/";
        preg_match_all($reg_exUrl, $text, $matches);
        $usedPatterns = array();
        foreach ($matches[0] as $pattern) {
            if (!array_key_exists($pattern, $usedPatterns)) {
                $usedPatterns[$pattern] = true;
                $text = str_replace($pattern, "<a class=userContent href='http:\\/\\/" . $pattern . "' target=_blank>" . $pattern . "</a>", $text);
            }
        }
        echo nl2br($text);
        //return $text;
    }
}
开发者ID:huangc28,项目名称:get_og_by_link,代码行数:30,代码来源:content.php


示例9: generateKML

function generateKML($kml_id, $resdir, $getmapurl, $wmsversion, $layername, $layertitle, $north, $south, $east, $west)
{
    $getmapurl = eregi_replace("&", "&amp;", $getmapurl);
    //$kml_id=md5(uniqid(rand(), true));
    if ($h = fopen($resdir . "/" . $kml_id . ".kml", "w+")) {
        //					$content = $text .chr(13).chr(10); //example for linefeeds
        $kml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . chr(13) . chr(10);
        $kml .= "<kml xmlns=\"http://earth.google.com/kml/2.2\">" . chr(13) . chr(10);
        $kml .= "<GroundOverlay>" . chr(13) . chr(10);
        $kml .= "<name>" . $layertitle . " - www.geoportal.rlp.de</name>" . chr(13) . chr(10);
        $kml .= "<Icon>" . chr(13) . chr(10);
        $kml .= "<href>" . $getmapurl . "VERSION=" . $wmsversion . "&amp;REQUEST=GetMap&amp;SRS=EPSG:4326&amp;WIDTH=512&amp;HEIGHT=512&amp;LAYERS=" . $layername . "&amp;STYLES=&amp;TRANSPARENT=TRUE&amp;BGCOLOR=0xffffff&amp;FORMAT=image/png&amp;</href>" . chr(13) . chr(10);
        //http://www.geoportal.rlp.de/owsproxy/3acc4cc90d02c754c531a9d5fa1b1545/5d38dd28a830f2c4ab97a506225d0a9b?VERSION=1.1.1&amp;REQUEST=GetMap&amp;SRS=EPSG:4326&amp;WIDTH=512&amp;HEIGHT=512&amp;LAYERS=boriweCD01&amp;TRANSPARENT=TRUE&amp;FORMAT=image/jpeg&amp;</href>
        $kml .= "<RefreshMode>onExpire</RefreshMode>" . chr(13) . chr(10);
        $kml .= "<viewRefreshMode>onStop</viewRefreshMode>" . chr(13) . chr(10);
        $kml .= "<viewRefreshTime>1</viewRefreshTime>" . chr(13) . chr(10);
        $kml .= "<viewBoundScale>0.87</viewBoundScale>" . chr(13) . chr(10);
        $kml .= "</Icon>" . chr(13) . chr(10);
        $kml .= "<LatLonBox>" . chr(13) . chr(10);
        $kml .= "<north>" . $north . "</north>" . chr(13) . chr(10);
        $kml .= "<south>" . $south . "</south>" . chr(13) . chr(10);
        $kml .= "<east>" . $east . "</east>" . chr(13) . chr(10);
        $kml .= "<west>" . $west . "</west>" . chr(13) . chr(10);
        $kml .= "</LatLonBox>" . chr(13) . chr(10);
        $kml .= "</GroundOverlay>" . chr(13) . chr(10);
        $kml .= "</kml>" . chr(13) . chr(10);
        if (!fwrite($h, $kml)) {
            #exit;
        }
        fclose($h);
    }
}
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:32,代码来源:mod_layerMetadata.php


示例10: FormatPropertiesForDatabaseInput

 function FormatPropertiesForDatabaseInput()
 {
     $this->Label = FormatStringForDatabaseInput($this->Label);
     $this->Contents = FormatStringForDatabaseInput($this->Contents);
     $this->Contents = eregi_replace("&lt;textarea&gt;", "<textarea>", $this->Contents);
     $this->Contents = eregi_replace("&lt;//textarea&gt;", "</textarea>", $this->Contents);
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:7,代码来源:Clipboard.php


示例11: CCIJavaBabble

function CCIJavaBabble($myoutput)
{
    global $mycrypto, $myalpha2, $javaencrypt, $preservehead;
    $s = $myoutput;
    $s = ereg_replace("\n", "", $s);
    if ($preservehead) {
        eregi("(^.+<body[^>]*>)", $s, $chunks);
        $outputstring = $chunks[1];
        eregi_replace($headpart, "", $s);
        eregi("(</body[^>]*>.*)", $s, $chunks);
        $outputend = $chunks[1];
        eregi_replace($footpart, "", $s);
    } else {
        $outputstring = "";
        $outputend = "";
    }
    if ($javaencrypt) {
        $s = strtr($s, $myalpha2, $mycrypto);
        $s = rawurlencode($s);
        $outputstring .= "<script>var cc=unescape('{$s}'); ";
        $outputstring .= "var index = document.cookie.indexOf('" . md5($_SERVER["REMOTE_ADDR"] . $_SERVER["SERVER_ADDR"]) . "='); " . "var aa = '{$myalpha2}'; " . "if (index > -1) { " . "  index = document.cookie.indexOf('=', index) + 1; " . "  var endstr = document.cookie.indexOf(';', index); " . "  if (endstr == -1) endstr = document.cookie.length; " . "  var bb = unescape(document.cookie.substring(index, endstr)); " . "} " . "cc = cc.replace(/[{$myalpha2}]/g,function(str) { return aa.substr(bb.indexOf(str),1) }); document.write(cc);";
    } else {
        $outputstring .= "<script>document.write(unescape('" . rawurlencode($s) . "'));";
    }
    $outputstring .= "</script><noscript>You must enable Javascript in order to view this webpage.</noscript>" . $outputend;
    return $outputstring;
}
开发者ID:smcaleer,项目名称:scriptmind-links,代码行数:27,代码来源:payment.php


示例12: PreLoad

 function PreLoad()
 {
     global $totalresult, $pageno;
     if (empty($pageno) || ereg("[^0-9]", $pageno)) {
         $pageno = 1;
     }
     if (empty($totalresult) || ereg("[^0-9]", $totalresult)) {
         $totalresult = 0;
     }
     $this->pageNO = $pageno;
     $this->totalResult = $totalresult;
     if (isset($this->tpl->tpCfgs['pagesize'])) {
         $this->pageSize = $this->tpl->tpCfgs['pagesize'];
     }
     $this->totalPage = ceil($this->totalResult / $this->pageSize);
     if ($this->totalResult == 0) {
         //$this->isQuery = true;
         //$this->dsql->Execute('mbdl',$this->sourceSql);
         //$this->totalResult = $this->dsql->GetTotalRow('mbdl');
         $countQuery = eregi_replace("select[ \r\n\t](.*)[ \r\n\t]from", "Select count(*) as dd From", $this->sourceSql);
         $row = $this->dsql->GetOne($countQuery);
         $this->totalResult = $row['dd'];
         $this->sourceSql .= " limit 0," . $this->pageSize;
     } else {
         $this->sourceSql .= " limit " . ($this->pageNO - 1) * $this->pageSize . "," . $this->pageSize;
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:27,代码来源:arc.memberlistview.class.php


示例13: trim

function SQL语句解析函数_应用于消息中心($sql, $操作记录编号)
{
    global $db, $MetaTables;
    //判断自定义表是否存在,如果不存在直接返回
    //判断是否是联合全操作,是否有子查询,是否用left
    //如果有,则表示为手写SQL代码,不是系统生成,则直接返回,不进行过滤
    $sql = trim($sql);
    //转成小写
    $sqllower = strtolower($sqllower);
    //缩进空格
    $sql = eregi_replace("  ", " ", $sql);
    $sql = eregi_replace("  ", " ", $sql);
    if (substr($sqllower, 0, strlen("insert into")) == "insert into") {
        $sqlArray = explode('insert into', $sql);
        $sqlArray = explode('values', $sqlArray[1]);
        $sqlArray = explode('(', $sqlArray[0]);
        $Tablename = $sqlArray[0];
        开始处理消息中心('INSERT', $Tablename, $数据字段, $操作记录编号);
    }
    if (substr($sqllower, 0, strlen("update")) == "update") {
        $sqlArray = explode('update', $sql);
        $sqlArray = explode('set', $sqlArray[1]);
        $Tablename = TRIM($sqlArray[0]);
    }
    if (substr($sqllower, 0, strlen("delete from")) == "delete from") {
        $sqlArray = explode('delete from', $sql);
        $sqlArray = explode(' ', $sqlArray[1]);
        $Tablename = TRIM($sqlArray[0]);
        开始处理消息中心('DELETE', $Tablename, $数据字段, $操作记录编号);
    }
}
开发者ID:shesai0519,项目名称:sunshineCRM,代码行数:31,代码来源:newai_message.php


示例14: ss_clean

function ss_clean($usertext)
{
    //  if ( eregi ("\"", $tabletext) )  { echo  "<p>Yesss!</p>"; }
    //  print  "<p>Test: ".eregi ( "<script", $tabletext )." (should give ereg output)</p>";
    //What about cases where multiple classes?
    $pattern = 'spreadsheetCellActive';
    $replacement = '';
    $usertext = eregi_replace($pattern, $replacement, $usertext);
    //remove any auto_locked rows or columns
    $pattern = 'auto_locked';
    $replacement = '';
    $usertext = eregi_replace($pattern, $replacement, $usertext);
    //remove any empty class statements
    $pattern = 'class="([[:space:]]*)"';
    $replacement = '';
    $usertext = eregi_replace($pattern, $replacement, $usertext);
    //debug regex -- leave here
    //echo "pattern: $pattern  ".htmlspecialchars(($usertext), ENT_QUOTES);
    //die;
    // Disable any attempt inject a script into the database
    $usertext = eregi_replace("<script", "<DISABLEDscript", $usertext);
    // Disable any attempt inject php into the database (ajaxed, but be sure)
    $usertext = eregi_replace("<[\\?]", "<DISABLED?", $usertext);
    return $usertext;
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:25,代码来源:ss_functions.php


示例15: makeClickableLinks

 function makeClickableLinks($text)
 {
     $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)', '<a href="\\1">\\1</a>', $text);
     $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)', '\\1<a href="http://\\2">\\2</a>', $text);
     $text = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $text);
     return $text;
 }
开发者ID:stillwyw,项目名称:badaral,代码行数:7,代码来源:format.php


示例16: ft_split

function ft_split($str)
{
    $str = eregi_replace("[ ]+", " ", $str);
    $tab = explode(" ", $str);
    sort($tab, SORT_STRING);
    return $tab;
}
开发者ID:qdiaz,项目名称:42_projects,代码行数:7,代码来源:ft_split.php


示例17: xmlParse

function xmlParse($data, $bList = "")
{
    $bArray = array();
    // if any attributes were passed to the function, add them to the array
    if (strlen($bList) > 0) {
        $bArray = explode(",", $bList);
    }
    // by: [email protected] - trim space around tags not within
    $data = eregi_replace(">" . "[[:space:]]+" . "<", "><", $data);
    // XML functions
    $p = xml_parser_create();
    // by: [email protected] - meets XML 1.0 specification
    xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
    xml_parse_into_struct($p, $data, $vals, $index);
    xml_parser_free($p);
    for ($x = 0; $x < count($vals); $x++) {
        if (array_key_exists("attributes", $vals[$x])) {
            foreach ($vals[$x]["attributes"] as $thiskey => $thisvalue) {
                // if the attribute name exists in the "bList" then re-cast the string to a boolean
                if (is_string($thisvalue) && array_search($thiskey, $bArray) !== false && (strtolower($thisvalue) == "true" || strtolower($thisvalue) == "false")) {
                    $vals[$x]["attributes"][$thiskey] = strtolower($thisvalue) == "true";
                }
            }
        }
    }
    $i = 0;
    $tree["xmlChildren"] = array();
    $tree["xmlChildren"][] = array('xmlName' => $vals[$i]['tag'], 'xmlAttributes' => getAttributes($vals, $i), 'xmlValue' => getValue($vals, $i), 'xmlChildren' => GetChildren($vals, $i));
    return $tree;
}
开发者ID:rodionbykov,项目名称:zCMS,代码行数:30,代码来源:fusebox4.loader.php4.php


示例18: get_term_from_file

 function get_term_from_file($current_file)
 {
     include "fse_config.php";
     $post_text = implode(" ", file($current_file));
     $post_text = eregi_replace("[^_0-9a-z-]", " ", strtolower($post_text));
     //explode by blank to generate token list
     $local_termlist = explode(" ", $post_text);
     for ($i = 0; $i < count($local_termlist); $i++) {
         //further striping
         $local_termlist[$i] = trim($local_termlist[$i]);
         //trim leading and tailing "-", "_"
         while (substr($local_termlist[$i], 0, 1) == "-" || substr($local_termlist[$i], 0, 1) == "_") {
             $local_termlist[$i] = substr($local_termlist[$i], 1);
         }
         while (substr($local_termlist[$i], -1) == "-" || substr($local_termlist[$i], -1) == "_") {
             $local_termlist[$i] = substr($local_termlist[$i], 0, strlen($local_termlist[$i]) - 1);
         }
         //if exclude digits, but the term concludes digit(s), then discard
         //if the term does not contain any a-z character discard
         if ($fse_exclude_digit && eregi("[0-9]", $local_termlist[$i])) {
             continue;
         }
         if (eregi("[a-z]", $local_termlist[$i]) && strlen($local_termlist[$i]) >= $fse_min_len) {
             $term_list[] = $local_termlist[$i];
         }
     }
     sort($term_list);
     return $term_list;
 }
开发者ID:jarvis57,项目名称:CS3244-Text-Classification-with-WEKA,代码行数:29,代码来源:fse_common.php


示例19: __call

 /**
  * 方法重载函数
  *
  * @access public
  * @param  string $function
  * @param  string $args
  * @return void
  */
 function __call($func, $args)
 {
     //获取类名
     $sDtoClass = get_class($args[0]);
     $sDmoClass = eregi_replace("DTO", "DMO", $sDtoClass);
     //echo $sDmoClass."::<br>";
     /*
     if(substr($sDmoClass, 0,3) != substr($this->childClass, 0,3))
     {
     	//echo "没有操作权限";
     	return false;
     }
     */
     if (!in_array($func, get_class_methods($sDmoClass))) {
         //echo "类方法不存在";
         return false;
     }
     //include_once(CLASS_DIR."/Module/src/_".$sClassName.".class.php");
     //include_once(CLASS_DIR."/Module/dev/".$sClassName.".class.php");
     $oDMOClass = new $sDmoClass();
     if ($args[1]) {
         return $oDMOClass->{$func}($args[0], $args[1]);
     } else {
         return $oDMOClass->{$func}($args[0]);
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:34,代码来源:InitLogic.class.php


示例20: html_activate_links

 /**
  * Convert links and emails in a text in html tags
  *
  * @return string Converted text
  */
 function html_activate_links(&$str)
 {
     $str = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '<a href="\\1" target="_blank">\\1</a>', $str);
     $str = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '\\1<a href="http://\\2" target="_blank">\\2</a>', $str);
     $str = eregi_replace('([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $str);
     return $str;
 }
开发者ID:BackupTheBerlios,项目名称:smart-svn,代码行数:12,代码来源:class.util.php



注:本文中的eregi_replace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP erp_html_form_input函数代码示例发布时间:2022-05-15
下一篇:
PHP eregi函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap