Esempio n. 1
0
function GetItems($xml)
{
    //returns a list with the positions in which
    //the tag <item> was found
    $list = Multi_strpos("\\<item\\>", $xml);
    return $list;
}
Esempio n. 2
0
function GetMultipartAlt($a)
{
    $order = array("\r\n", "\n", "\r");
    $replace = ' ';
    $a = str_replace($order, $replace, $a);
    $parts = Multi_strpos("Content-Type", $a);
    for ($i = 0; $i < sizeof($parts); $i++) {
        $ret[$i]["name"] = "";
        $type_start = $parts[$i] + 13;
        $type_end = strpos($a, ";", $type_start);
        $typesz = $type_end - $type_start;
        $ret[$i]["type"] = trim(substr($a, $type_start, $typesz));
        $aend = strpos($a, "--", $type_end) - 1;
        $asz = $aend - $type_end;
        $ret[$i]["attachment"] = trim(substr($a, $type_end + 1, $asz));
        //Mumbai
        $ret[$i]["attachment"] = trim(substr($ret[$i]["attachment"], strpos($ret[$i]["attachment"], "to view the message.") + 20));
    }
    return $ret;
}