首页 > PHP开源 > 如何轮换两个或更多字符串–kohana3使用手册

如何轮换两个或更多字符串–kohana3使用手册

2011年2月24日 发表评论 阅读评论

Text::alternate()方法接受两个或更多字符串参数,并且会在它每次被调用时返回不同的字符窜
echo Text::alternate(‘You are cool’,'You are smart’,'You are funny’);
echo Text::alternate(‘You are nice’,'You are happy’,'You are stinky’);
echo Text::alternate(‘You are ugly’,'You are sleepy’,'You are bored’);
将返回
You are cool
You are happy
You are bored

分类: PHP开源 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.