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


PHP outputText函数代码示例

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


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

示例1: start

function start()
{
    global $stopTime, $iterations, $T, $res, $n, $m;
    $stopTime = microtime(true) + $T;
    // NOW + T seconds
    while (microtime(true) < $stopTime) {
        reinit();
        calc();
        $iterations++;
    }
    $iterations--;
    // last iteration started before time was up but finished after time was up
    // required '>' mark for automatic benchmark
    print "> {$iterations} iterations\n";
    print "Resulting F(W, S) = {$res[0]}\n";
    outputText();
}
开发者ID:vburlai,项目名称:lang-benchmarks,代码行数:17,代码来源:main.php

示例2: algebra2tex

        $output = algebra2tex($algebra);
    }
    if (strpos($query, 'TeXStage2')) {
        $output = algebra2tex($algebra);
        $output = refineTeX($output);
    }
    if (strpos($query, 'ShowImage') || strpos($query, 'SlashArguments')) {
        $output = algebra2tex($algebra);
        $output = refineTeX($output);
        if (strpos($query, 'ShowImage')) {
            tex2image($output, $md5);
        } else {
            slasharguments($output, $md5);
        }
    } else {
        outputText($output);
    }
    exit;
}
function algebra2tex($algebra)
{
    global $CFG;
    $algebra = str_replace('&lt;', '<', $algebra);
    $algebra = str_replace('&gt;', '>', $algebra);
    $algebra = str_replace('<>', '#', $algebra);
    $algebra = str_replace('<=', '%', $algebra);
    $algebra = str_replace('>=', '!', $algebra);
    $algebra = preg_replace('/([=><%!#] *)-/', "\$1 zeroplace -", $algebra);
    $algebra = str_replace('delta', 'zdelta', $algebra);
    $algebra = str_replace('beta', 'bita', $algebra);
    $algebra = str_replace('theta', 'thita', $algebra);
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:31,代码来源:algebradebug.php

示例3: die

         $stmt = $db->prepare($sql);
         $stmt->bindParam(':id', $ID);
     }
     $stmt->execute();
     $row = $stmt->fetch();
     if ($row['ID'] == null) {
         die("105");
     }
     global $downloads;
     $downloads = $row['downloads'] + 1;
     switch ($Type) {
         case "JSON":
             echo outputJSON($row);
             break;
         case "TEXT":
             echo outputText($row);
             break;
         case "YAML":
             echo outputYaml($row);
             break;
         case "ID":
             echo outputID($row);
             break;
         case "DUMP":
             echo outputDump($row);
             break;
         default:
             echo outputJSON($row);
             break;
     }
 }
开发者ID:CrazyDev,项目名称:minewriter,代码行数:31,代码来源:query.php

示例4: foreach

foreach ($outputColors as $outputColorCode => $outputColorParam) {
    outputText("Generating icon color of '{$outputColorCode}px'... ");
    foreach ($outputSizes as $outputSize) {
        $htmlBuffer = sprintf('<h1>%s</h1><p>Generated by <a href="%s">%s</a> on %s</p>', $CONFIGS['font'], "https://github.com/exiang/php-font-awesome-to-png", "php-font-awesome-to-png", date("r")) . "\n\n";
        outputText("Generating icon size of '{$outputSize}px'... ");
        $size = $width = $height = $outputSize * 3;
        $fontSize = $outputSize;
        $padding = (int) ceil($outputSize / 25);
        // The text to draw
        foreach ($icons as $iKey => $iParam) {
            outputText("Generating icon '{$iKey}'... ");
            $text = $iParam['code'];
            $fileName = sprintf("%s/%s/%s/%s.png", $outputDir, $outputColorCode, $outputSize, $iKey);
            $dirPath = dirname($fileName);
            if (!is_dir($dirPath) || !file_exists($dirPath)) {
                outputText("Try to create '{$dirPath}'... ");
                mkdir_recursive($dirPath, 0777);
            }
            // Create the image
            $im = imagecreatetruecolor($width, $height);
            imagealphablending($im, false);
            // Create some colors
            $fontC = imagecolorallocate($im, $outputColorParam['r'], $outputColorParam['g'], $outputColorParam['b']);
            $bgc = imagecolorallocatealpha($im, 255, 0, 255, 127);
            imagefilledrectangle($im, 0, 0, $width, $height, $bgc);
            imagealphablending($im, true);
            // Add the text
            list($fontX, $fontY) = ImageTTFCenter($im, $text, $font, $fontSize);
            imagettftext($im, $fontSize, 0, $fontX, $fontY, $fontC, $font, $text);
            // Using imagepng() results in clearer text compared with imagejpeg()
            imagealphablending($im, false);
开发者ID:terry2010,项目名称:php-font-awesome-to-png,代码行数:31,代码来源:generate.php

示例5: pecho

/**
 * Shortcut for {@link outputText}
 *
 * @param string $text Text to display
 * @param int $cat Category of text, such as PECHO_WARN, PECHO_NORMAL
 * @param string $func
 * @link outputText
 * @return void
 */
function pecho($text, $cat = 0, $func = 'echo')
{
    global $pgWebOutput;
    if ($pgWebOutput) {
        $text = str_replace("\n", "<br>", $text);
    }
    outputText($text, $cat, $func);
}
开发者ID:emijrp,项目名称:Peachy,代码行数:17,代码来源:GenFunctions.php


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