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

PHP box函数代码示例

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

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



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

示例1: test

 /**
  * Search tree test program.
  *
  * @param object ISearchTree $tree The tree to test.
  */
 public static function test(ISearchTree $tree)
 {
     printf("AbstractSearchTree test program.\n");
     printf("%s\n", str($tree));
     for ($i = 1; $i <= 8; ++$i) {
         $tree->insert(box($i));
     }
     printf("%s\n", str($tree));
     printf("Breadth-First traversal\n");
     $tree->breadthFirstTraversal(new PrintingVisitor(STDOUT));
     printf("Preorder traversal\n");
     $tree->depthFirstTraversal(new PreOrder(new PrintingVisitor(STDOUT)));
     printf("Inorder traversal\n");
     $tree->depthFirstTraversal(new InOrder(new PrintingVisitor(STDOUT)));
     printf("Postorder traversal\n");
     $tree->depthFirstTraversal(new PostOrder(new PrintingVisitor(STDOUT)));
     printf("Using foreach\n");
     foreach ($tree as $obj) {
         printf("%s\n", str($obj));
     }
     printf("Using reduce\n");
     $tree->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
     printf("Using accept\n");
     $tree->accept(new ReducingVisitor(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), ''));
     printf("Withdrawing 4\n");
     $obj = $tree->find(box(4));
     try {
         $tree->withdraw($obj);
         printf("%s\n", str($tree));
     } catch (Exception $e) {
         printf("Caught %s\n", $e->getMessage());
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:38,代码来源:AbstractSearchTree.php


示例2: test

 /**
  * PriorityQueue test method.
  *
  * @param object IPriorityQueue $pqueue The queue to test.
  */
 public static function test(IPriorityQueue $pqueue)
 {
     printf("AbstractPriorityQueue test program.\n");
     printf("%s\n", str($pqueue));
     $pqueue->enqueue(box(3));
     $pqueue->enqueue(box(1));
     $pqueue->enqueue(box(4));
     $pqueue->enqueue(box(1));
     $pqueue->enqueue(box(5));
     $pqueue->enqueue(box(9));
     $pqueue->enqueue(box(2));
     $pqueue->enqueue(box(6));
     $pqueue->enqueue(box(5));
     $pqueue->enqueue(box(4));
     printf("%s\n", str($pqueue));
     printf("Using reduce\n");
     $pqueue->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
     printf("Using foreach\n");
     foreach ($pqueue as $obj) {
         printf("%s\n", str($obj));
     }
     printf("Dequeueing\n");
     while (!$pqueue->isEmpty()) {
         $obj = $pqueue->dequeueMin();
         printf("%s\n", str($obj));
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:32,代码来源:AbstractPriorityQueue.php


示例3: test

 /**
  * Stack test method.
  *
  * @param object IStack $stack The stack to test.
  */
 public static function test(IStack $stack)
 {
     printf("AbstractStack test program.\n");
     for ($i = 0; $i < 6; ++$i) {
         if ($stack->isFull()) {
             break;
         }
         $stack->push(box($i));
     }
     printf("%s\n", str($stack));
     printf("Using foreach\n");
     foreach ($stack as $obj) {
         printf("%s\n", str($obj));
     }
     printf("Using reduce\n");
     $stack->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
     printf("Top is %s\n", str($stack->getTop()));
     printf("Popping\n");
     while (!$stack->isEmpty()) {
         $obj = $stack->pop();
         printf("%s\n", str($obj));
     }
     $stack->push(box(2));
     $stack->push(box(4));
     $stack->push(box(6));
     printf("%s\n", str($stack));
     printf("Purging\n");
     $stack->purge();
     printf("%s\n", str($stack));
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:35,代码来源:AbstractStack.php


示例4: test

 /**
  * OrderedList test method.
  *
  * @param object IOrderedList $list The list to test.
  */
 public static function test(IOrderedList $list)
 {
     printf("AbstractOrderedList test program.\n");
     $list->insert(box(1));
     $list->insert(box(2));
     $list->insert(box(3));
     $list->insert(box(4));
     printf("%s\n", str($list));
     $obj = $list->find(box(2));
     $list->withdraw($obj);
     printf("%s\n", str($list));
     $position = $list->findPosition(box(3));
     $position->insertAfter(box(5));
     printf("%s\n", str($list));
     $position->insertBefore(box(6));
     printf("%s\n", str($list));
     $position->withdraw();
     printf("%s\n", str($list));
     printf("Using foreach\n");
     foreach ($list as $obj) {
         printf("%s\n", str($obj));
     }
     printf("Using reduce\n");
     $list->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:30,代码来源:AbstractOrderedList.php


示例5: rhcontent

function rhcontent()
{
    date_default_timezone_set("Europe/London");
    $stuff = "Submitted " . date('l dS \\of F Y h:i:s A') . "\n";
    ob_start();
    print_r($_POST);
    $stuff .= ob_get_contents();
    ob_end_clean();
    $ouremail = "[email protected]";
    mail($ouremail, "Swaledale booking", $stuff, "From: {$ouremail}");
    extract($_POST);
    $balance = $cost - 25;
    $message = <<<EOT
_Thanks for your booking request._

We can confirm your place on the Swaledale Squeeze once we have received your deposit of £25 payable to Swaledale Squeeze at: 

    Steven Bradley
    Annfield House
    Front Street
    Langley Park
    Durham
    DH7 9XE

If you wish you can pay the full amount of £{$cost} now or pay the deposit now and the balance of £{$balance} by 1st May 2016.

Once I receive your deposit I'll let you know.

Thanks from Steven
EOT;
    box(Markdown($message));
    mail($_POST['email'], "Swaledale Squeeze: thanks for booking", $message, "From: {$ouremail}");
    box("We've also sent these instructions to your email address. Thanks again.");
}
开发者ID:stevenaeola,项目名称:swaledalesqueeze,代码行数:34,代码来源:bookingthanks.php


示例6: test

 /**
  * Deque test method.
  *
  * @param object IDeque $deque The deque to test.
  */
 public static function test(IDeque $deque)
 {
     printf("AbstractDeque test program.\n");
     for ($i = 0; $i <= 5; ++$i) {
         if (!$deque->isFull()) {
             $deque->enqueueHead(box($i));
         }
         if (!$deque->isFull()) {
             $deque->enqueueTail(box($i));
         }
     }
     printf("%s\n", str($deque));
     printf("getHead = %s\n", str($deque->getHead()));
     printf("getTail = %s\n", str($deque->getTail()));
     printf("Using reduce\n");
     $deque->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
     printf("Using foreach\n");
     foreach ($deque as $obj) {
         printf("%s\n", str($obj));
     }
     printf("Dequeueing\n");
     while (!$deque->isEmpty()) {
         printf("%s\n", str($deque->dequeueHead()));
         if ($deque->isEmpty()) {
             break;
         }
         printf("%s\n", str($deque->dequeueTail()));
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:34,代码来源:AbstractDeque.php


示例7: rhcontent

function rhcontent()
{
    box("<h1>For everybody</h1>\r\n<p>\r\nAll of the workshop sessions take place in the Youth Hostel. Coffee and tea are povided in break times. Three kegs of the local Black Sheep Ale are available for self-service with an honesty box and other alcoholic drinks are available to buy from the Youth Hostel. You are welcome to bring your own alcohol to the ceilidh but not to consume at Grinton Lodge.\r\n</p>");
    box("<h1>Youth Hostel bunks</h1>\r\n<p>Most people stay in the Youth Hostel itself, in comfortable bunk rooms with provided bedding. Meals (breakfast, lunch and dinner) are included for all those in bunks, with an optional Friday evening meal at 7.00.</p>\r\n");
    box("<h1>Camping</h1>\r\n<p>\r\nThere is a camping field next to the Youth Hostel which is suitable for tents, although access by car to the camping field is difficult. (Actually, getting in is quite easy, but getting out can be tricky, particularly if the grass is wet.) Camper vans can stay in the courtyard of the Youth Hostel with access to a toilet, but no electric hook-up. Campers are  welcome to use the self-catering kitchen in the hostel.\r\n</p>");
    box("<h1>Pods</h1>\r\n<p>\r\nThere are a some self-catering pods in the grounds of the hostel, which are a bit like wooden teepees. The largest of these pods can sleep up to five people at a push, the smaller ones can sleep up to three.\r\n</p>\r\n");
    box("<h1>Bed and breakfast</h1>\r\n<p>\r\nThere is a range of bed and breakfast accommodation in the area which you would need to book independently. If you have difficulty finding somewhere appropriate then please let us know and we may be able to help.\r\n</p>");
}
开发者ID:stevenaeola,项目名称:swaledalesqueeze,代码行数:8,代码来源:accommodation.php


示例8: describe

 function describe($message, $closure, $timeout = null, $type = 'normal')
 {
     if (!Suite::current()) {
         $suite = box('kahlan')->get('suite.global');
         return $suite->describe($message, $closure, $timeout, $type);
     }
     return Suite::current()->describe($message, $closure, $timeout, $type);
 }
开发者ID:crysalead,项目名称:kahlan,代码行数:8,代码来源:init.php


示例9: buildTree

 /**
  * Builds an N-ary tree that contains character keys in the given range.
  *
  * @param integer lo The lower bound of the range.
  * @param integer hi The upper bound of the range.
  * @return An N-ary tree.
  */
 public static function buildTree($lo, $hi)
 {
     $mid = intval(($lo + $hi) / 2);
     $result = new NaryTree(2, box(chr($mid)));
     if ($lo < $mid) {
         $result->attachSubtree(0, self::buildTree($lo, $mid - 1));
     }
     if ($hi > $mid) {
         $result->attachSubtree(1, self::buildTree($mid + 1, $hi));
     }
     return $result;
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:19,代码来源:Application2.php


示例10: test

 /**
  * SortedList test method.
  *
  * @param object ISortedList $list The list to test.
  */
 public static function test(ISortedList $list)
 {
     printf("AbstractSortedList test program.\n");
     $list->insert(box(4));
     $list->insert(box(3));
     $list->insert(box(2));
     $list->insert(box(1));
     printf("%s\n", str($list));
     $obj = $list->find(box(2));
     $list->withdraw($obj);
     printf("%s\n", str($list));
     printf("Using foreach\n");
     foreach ($list as $obj) {
         printf("%s\n", str($obj));
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:21,代码来源:AbstractSortedList.php


示例11: main

 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("Box main program.\n");
     $status = 0;
     $box = box(false);
     printf("%s\n", str($box));
     $box = box(57);
     printf("%s\n", str($box));
     $box = box(1.5);
     printf("%s\n", str($box));
     $box = box('test');
     printf("%s\n", str($box));
     $box = box(array(1, 2, 3));
     printf("%s\n", str($box));
     return $status;
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:22,代码来源:Box.php


示例12: rhcontent

function rhcontent()
{
    box("<h1>Concertina weekend 19-21 May 2017</h1>\n<p>Details of tutors are yet to be confirmed, but keep these dates in your diary if you'd like to come in 2017.</p>\n");
    /*
    box("<h1>Concertina weekend 20-22 May 2016</h1>
    <p>The guest tutors for the 2016 squeeze are Brian Peters (Anglo),
    Iris Bishop (Duet) and 
    Alex Wade (English), with additional workshops from Paul McCann (Duet)
    and Rob Say (English). Our regular tutors are Harry Scurfield (Anglo), Paul Walker (English/Anglo), Carolyn Wade (Band)  and Dave Ball (Band/English).</p>
    ");
    */
    /*
    Use the navigation links on the left hand side to find out 
    ore about the <a href='course.php'>tutors and course details</a>, <a href='accommodation.php'>accommodation</a> and <a href='booking.php'>booking</a>
    */
    box("<img src='images/friendly_concertina.jpg' alt='friendly concertina' height='313' align='center'/>   ");
}
开发者ID:stevenaeola,项目名称:swaledalesqueeze,代码行数:17,代码来源:index.php


示例13: test

 /**
  * DoubledEndedPriorityQueue test method.
  *
  * @param object IPriorityQueue $pqueue The queue to test.
  */
 public static function test(IPriorityQueue $pqueue)
 {
     printf("AbstractDoubledEndedPriorityQueue test program.\n");
     AbstractPriorityQueue::test($pqueue);
     printf("%s\n", str($pqueue));
     $pqueue->enqueue(box(3));
     $pqueue->enqueue(box(1));
     $pqueue->enqueue(box(4));
     $pqueue->enqueue(box(1));
     $pqueue->enqueue(box(5));
     $pqueue->enqueue(box(9));
     $pqueue->enqueue(box(2));
     $pqueue->enqueue(box(6));
     $pqueue->enqueue(box(5));
     $pqueue->enqueue(box(4));
     printf("%s\n", str($pqueue));
     while (!$pqueue->isEmpty()) {
         $obj = $pqueue->dequeueMax();
         printf("%s\n", str($obj));
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:26,代码来源:AbstractDoubleEndedPriorityQueue.php


示例14: rhcontent

function rhcontent()
{
    box("<h1>Tutors</h1>\r\n<p>The guest tutors for the 2016 squeeze are Brian Peters (Anglo),\r\nIris Bishop (Duet) and \r\nAlex Wade (English), with additional workshops from Paul McCann (Duet)\r\nand Rob Say (English). Our regular tutors are Harry Scurfield (Anglo), Paul Walker (English/Anglo), Carolyn Wade (Band)  and Dave Ball (Band/English). Together they provide workshops covering a whole range of concertina playing for different abilities, systems and styles.\r\n</p>");
    box("<h1>Timetable</h1>\r\n<p>\r\nThe weekend starts on Friday 20th May. We have two informal sessions including the Dotty session, with written music provided for the tunes. Saturday includes teaching workshops in the morning and afternoon, an informal tea-time concert and a ceilidh in the evening at Reeth Memorial Hall, with the band for the ceilidh and the 'spots' provided by participants. There are more workshops on Sunday morning before the farewell concert on Sunday afternoon, again in Reeth Memorial Hall, featuring spots from the tutors and their workshop groups. You can download more details on the <a href='2016/SwaledaleProgramme2016.pdf'>exact timings</a> and <a href='2016/SwaledaleWorkshopDetails2016.pdf'>workshop details</a>.</p>");
    box("<h1>Other features</h1>\r\n<p>\r\nOn Friday afternoon there is a walk around Swaledale for those who wish to join it. We also have Dave Elliott's concertina clinic and Chris Algar's (Barleycorn Concertinas) emporium on Saturday. Families and friends are welcome too - they may enjoy the area's many craft shops, tearooms and outstanding walks and are welcome to bring other musical instruments for joining in sessions or the ceilidh band. \r\n</p>");
}
开发者ID:stevenaeola,项目名称:swaledalesqueeze,代码行数:6,代码来源:course.php


示例15: box

<?php

namespace Chaos\Database\Spec\Suite;

use Lead\Set\Set;
use Chaos\ChaosException;
use Chaos\Database\DatabaseException;
use Chaos\Model;
use Chaos\Finders;
use Chaos\Database\Query;
use Chaos\Database\Schema;
use Chaos\Database\Spec\Fixture\Fixtures;
$box = box('chaos.spec');
$connections = ["MySQL" => $box->has('source.database.mysql') ? $box->get('source.database.mysql') : null, "PgSql" => $box->has('source.database.postgresql') ? $box->get('source.database.postgresql') : null];
foreach ($connections as $db => $connection) {
    describe("Query[{$db}]", function () use($connection) {
        beforeAll(function () use($connection) {
            skipIf(!$connection);
        });
        beforeEach(function () use($connection) {
            $this->connection = $connection;
            $this->fixtures = new Fixtures(['connection' => $connection, 'fixtures' => ['gallery' => 'Chaos\\Database\\Spec\\Fixture\\Schema\\Gallery', 'gallery_detail' => 'Chaos\\Database\\Spec\\Fixture\\Schema\\GalleryDetail', 'image' => 'Chaos\\Database\\Spec\\Fixture\\Schema\\Image', 'image_tag' => 'Chaos\\Database\\Spec\\Fixture\\Schema\\ImageTag', 'tag' => 'Chaos\\Database\\Spec\\Fixture\\Schema\\Tag']]);
            $this->fixtures->populate('gallery', ['create']);
            $this->fixtures->populate('gallery_detail', ['create']);
            $this->fixtures->populate('image', ['create']);
            $this->fixtures->populate('image_tag', ['create']);
            $this->fixtures->populate('tag', ['create']);
            $this->gallery = $this->fixtures->get('gallery')->model();
            $this->galleryDetail = $this->fixtures->get('gallery_detail')->model();
            $this->image = $this->fixtures->get('image')->model();
            $this->image_tag = $this->fixtures->get('image_tag')->model();
开发者ID:crysalead,项目名称:chaos-database,代码行数:31,代码来源:Query.spec.php


示例16: __construct

 /**
  * Constructs a Simulation_Event with the given type and time.
  *
  * @param integer $type The type of the event.
  * @param integer $time The time of the event.
  */
 public function __construct($type, $time)
 {
     parent::__construct(box($time), box($type));
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:10,代码来源:Simulation.php


示例17: it

    });
    it("removes a box", function () {
        $box = new Box();
        box('box.spec', $box);
        box('box.spec', false);
        $closure = function () {
            box('box.spec');
        };
        expect($closure)->toThrow(new BoxException("Unexisting box `'box.spec'`."));
    });
    it("removes all boxes", function () {
        $box = new Box();
        box('box.spec1', $box);
        box('box.spec2', $box);
        box(false);
        $closure = function () {
            box('box.spec1');
        };
        expect($closure)->toThrow(new BoxException("Unexisting box `'box.spec1'`."));
        $closure = function () {
            box('box.spec2');
        };
        expect($closure)->toThrow(new BoxException("Unexisting box `'box.spec2'`."));
    });
    it("throws an exception when trying to get an unexisting box", function () {
        $closure = function () {
            box('box.spec');
        };
        expect($closure)->toThrow(new BoxException("Unexisting box `'box.spec'`."));
    });
});
开发者ID:Ilyes512,项目名称:kahlan,代码行数:31,代码来源:BoxSpec.php


示例18: session_regenerate_id

if (isGET('login')) {
    if (checkBot() && check('password') && login(cleanMagic($_POST['password']))) {
        session_regenerate_id(true);
        home();
    } else {
        $out['title'] = $lang['login'];
        $out['content'] .= '<form action="./auth.php?login" method="post">
    <p>' . password('password') . '</p>
    <p>' . submitSafe($lang['confirm']) . '</p>
    </form>';
    }
} else {
    if (isGET('logout') && isAdmin()) {
        $_SESSION['role'] = '';
        home();
    } else {
        if (isGET('test') && isAdmin()) {
            $out['title'] = $lang['login'];
            $out['content'] .= '<form action="./auth.php?test" method="post">
  <p>' . password('password') . '</p>
  <p>' . submitAdmin($lang['confirm']) . '</p>
  </form>';
            if (check('password')) {
                $out['content'] .= box(hide(cleanMagic($_POST['password'])));
            }
        } else {
            home();
        }
    }
}
require './templates/page.php';
开发者ID:zhizunbaonie,项目名称:blog,代码行数:31,代码来源:auth.php


示例19: ob_get_clean

<?php

/********************************************
 * @Created on March, 2011 * @Package: Ndotdeals unlimited v2.2 
 * @Author: NDOT
 * @URL : http://www.ndot.in
 ********************************************/
$s = ob_get_clean();
box('box', $gPage, $s, '', 'margin-bottom: 10px;');
?>
                     </div>
		          
		          <div class="content_bottom"><div class="bot_left"></div><div class="bot_center"></div><div class="bot_rgt"></div></div>
		          
	 </div>           

	</td>
</tr>
</table>



</div>

</div>
<div class="login_footer ">
      <p> Copyright &copy; <?php 
echo date("Y");
?>
 Ndot.in. All Rights Reserved.</p>
</div>
开发者ID:AdoSalkic,项目名称:personal,代码行数:31,代码来源:footer.php


示例20: main

 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("Application program number 11.\n");
     $status = 0;
     $g = new GraphAsMatrix(32);
     Application11::weightedGraphTest($g);
     $g = new GraphAsLists(32);
     Application11::weightedGraphTest($g);
     $g = new DigraphAsMatrix(32);
     Application11::weightedDigraphTest($g);
     $g = new DigraphAsLists(32);
     Application11::weightedDigraphTest($g);
     printf("Critical path analysis.\n");
     $g = new DigraphAsMatrix(10);
     for ($v = 0; $v < 10; ++$v) {
         $g->addVertex($v);
     }
     $g->addEdge(0, 1, box(3));
     $g->addEdge(1, 2, box(1));
     $g->addEdge(1, 3, box(4));
     $g->addEdge(2, 4, box(0));
     $g->addEdge(3, 4, box(0));
     $g->addEdge(4, 5, box(1));
     $g->addEdge(5, 6, box(9));
     $g->addEdge(5, 7, box(5));
     $g->addEdge(6, 8, box(0));
     $g->addEdge(7, 8, box(0));
     $g->addEdge(8, 9, box(2));
     printf("%s\n", str($g));
     $g2 = Algorithms::criticalPathAnalysis($g);
     printf("%s\n", str($g2));
     return $status;
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:39,代码来源:Application11.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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