当前位置: 首页>>代码示例>>PHP>>正文


PHP filename_to_url函数代码示例

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


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

示例1: mysql_unbuffered_query

$sqlresults = mysql_unbuffered_query($sql);
$out = "";
if ($sqlresults) {
    while ($data = mysql_fetch_assoc($sqlresults)) {
        $csv->newrow();
        $csv->addfield($data['id'], 'integer');
        $csv->addfield($data['url'], 'string');
        if (isset($data['url_followed']) && strlen($data['url_followed']) > 1) {
            $csv->addfield($data['url'], 'string');
        } else {
            $csv->addfield('', 'string');
        }
        if (isset($data['url_expanded']) && strlen($data['url_expanded']) > 1) {
            $csv->addfield($data['url_expanded'], 'string');
        } else {
            $csv->addfield('', 'string');
        }
        $csv->writerow();
    }
    mysql_free_result($sqlresults);
}
$csv->close();
echo '<fieldset class="if_parameters">';
echo '<legend>Your File</legend>';
echo '<p><a href="' . filename_to_url($filename) . '">' . $filename . '</a></p>';
echo '</fieldset>';
?>

    </body>
</html>
开发者ID:01123578,项目名称:dmi-tcat,代码行数:30,代码来源:mod.export_urls.php

示例2: variabilityOfAssociationProfiles


//.........这里部分代码省略.........
    // 	get associated words (depth 1) per slice
    // 	get frequency, degree, ap variation (calculated on cooc frequency), words in, words out, ap keywords
    $degree = array();
    foreach ($series as $time => $cw) {
        $cw = $cw->getCowords();
        foreach ($cw as $word => $cowords) {
            foreach ($cowords as $coword => $frequency) {
                // save how many time slices the word appears
                $words[$word][$time] = 1;
                $words[$coword][$time] = 1;
                // keep track of degree per word per time slice
                if (array_key_exists($word, $degree) === false) {
                    $degree[$word] = array();
                }
                if (array_key_exists($coword, $degree) === false) {
                    $degree[$coword] = array();
                }
                if (array_key_exists($time, $degree[$word]) === false) {
                    $degree[$word][$time] = 0;
                }
                if (array_key_exists($time, $degree[$coword]) === false) {
                    $degree[$coword][$time] = 0;
                }
                $degree[$word][$time]++;
                $degree[$coword][$time]++;
            }
        }
    }
    // count nr of time slices the words appears in
    foreach ($words as $word => $times) {
        $documentsPerWords[$word] = count($times);
    }
    // calculate similarity and changes
    foreach ($ap as $word => $times) {
        $times_keys = array_keys($times);
        for ($i = 1; $i < count($times_keys); $i++) {
            $im1 = $i - 1;
            $v1 = $times[$times_keys[$im1]];
            $v2 = $times[$times_keys[$i]];
            $cos_sim[$word][$times_keys[$i]] = cosineSimilarity($v1, $v2);
            $change_out[$word][$times_keys[$i]] = change($v1, $v2);
            $change_in[$word][$times_keys[$i]] = change($v2, $v1);
            $stable[$word][$times_keys[$i]] = array_intersect(array_keys($v1), array_keys($v2));
        }
    }
    // @todo, frequency
    $out = "key\ttime\tdegree\tsimilarity\tassociational profile\tchange in\tchange out\tstable\n";
    foreach ($ap as $word => $times) {
        foreach ($times as $time => $profile) {
            if (isset($change_in[$word][$time])) {
                $inc = "";
                foreach ($change_in[$word][$time] as $w => $c) {
                    $inc .= "{$w} ({$c}), ";
                }
                $inc = substr($inc, 0, -2);
            } else {
                $inc = "";
            }
            if (isset($change_out[$word][$time])) {
                $outc = "";
                foreach ($change_out[$word][$time] as $w => $c) {
                    $outc .= "{$w} ({$c}), ";
                }
                $outc = substr($outc, 0, -2);
            } else {
                $outc = "";
            }
            if (isset($stable[$word][$time])) {
                $stablec = array();
                foreach ($stable[$word][$time] as $w) {
                    $stablec[] = $w;
                }
                $stablec = implode(", ", $stablec);
            } else {
                $stablec = "";
            }
            $prof = "";
            foreach ($profile as $w => $c) {
                $prof .= "{$w} ({$c}), ";
            }
            $prof = substr($prof, 0, -2);
            if (isset($degree[$word][$time])) {
                $deg = $degree[$word][$time];
            } else {
                $deg = "";
            }
            if (isset($cos_sim[$word][$time])) {
                $cs = $cos_sim[$word][$time];
            } else {
                $cs = "";
            }
            $out .= $word . "\t" . $time . "\t" . $deg . "\t" . $cs . "\t" . $prof . "\t" . $inc . "\t" . $outc . "\t" . $stablec . "\n";
        }
    }
    file_put_contents($filename, chr(239) . chr(187) . chr(191) . $out);
    echo '<fieldset class="if_parameters">';
    echo '<legend>Your co-hashtag variability File</legend>';
    echo '<p><a href="' . filename_to_url($filename) . '">' . $filename . '</a></p>';
    echo '</fieldset>';
}
开发者ID:jlorberkasunic,项目名称:dmi-tcat,代码行数:101,代码来源:mod.hashtag_variability.php

示例3: get_file

function get_file($what)
{
    validate_all_variables();
    // get filename (this also validates the data)
    global $database;
    $filename = get_filename_for_export($what);
    generate($what, $filename);
    // redirect to file
    $location = str_replace("index.php", "", ANALYSIS_URL) . filename_to_url($filename);
    if (defined('LOCATION')) {
        $location = LOCATION . $location;
    }
    header("Content-type: text/csv");
    header("Location: {$location}");
}
开发者ID:pwikstrom,项目名称:dmi-tcat,代码行数:15,代码来源:functions.php

示例4: htmlspecialchars

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>TCAT :: Export Tweets</title>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <link rel="stylesheet" href="css/main.css" type="text/css" />

        <script type="text/javascript" language="javascript">

        </script>

    </head>

    <body>

        <h1>TCAT :: Export Tweets</h1>

<?php 
echo '<fieldset class="if_parameters">';
echo '<legend>Your File</legend>';
echo '<p>';
echo '<a href="' . htmlspecialchars(filename_to_url($filename)) . '">';
echo htmlspecialchars($filename);
echo '</a></p>';
echo '</fieldset>';
?>

    </body>
</html>
开发者ID:pwikstrom,项目名称:dmi-tcat,代码行数:30,代码来源:mod.export_tweets.php


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