PHP中的字符串操作功能是比较多的,重要的有以下这些:

  (1)echo,print,printf,sprintf
  前两个函数是输出字符串.字符串中如果有变量名则被替换成其值. 后两个函数类似于C的同名函数.

  (2)strchr,strlen,strtok,strrchr,strrev,strstr,strtolower, strtoupper,substr,ucfirst
  这些是常用的字符串操作函数,有些和C中的同名函数意义完全一致.
  strrev是把一个字符串翻转.
  strtolower和strtoupper的意思应该不用解释了.
  ucfirst是把字符串的第一个字符变成大写.
  substr是返回字符串的一个子串,用法是:substr(字符串,头,长度).
  头位置是 从0算起的.如果是负数,则是从尾部向前数的意思.

  (3)Chr,Ord
  类似于C的同名函数.

  (4)explode,implode,join
  这些是和数组有关的函数.
  explode(字符串,分割符)返回一个将字符串在分割符处分开所产生的数组.
  implode(数组,分割符)返回一个将数组各元素之间插上分割符而成的字符串.
  join与implode意义相同.

  (5)Chop
  去掉字符串尾部的空白.

  (6)htmlspecialchars
  将字符串中的HTML特殊字符换成它们的名字,例如"< "变成"<".

  (7)nl2br
  在字符串中的每一个回车前面加上"< BR>".

  (8)AddSlashes,StripSlashes
  分别给字符串中需要加上""才能用于数据库查询的字符加上和去掉"".

  (9)parse_str
  将"name1=value1&name2=value2&..."类型的字符串分析成一些变量.
  例如:
  parse_str("a=1&b=2");
  生成$a与$b两个变量,值分别为1,2. 如果有两对名字/值的名字部分相同,则后一个的值覆盖前一个的. 如果这两对的名字尾部都有"",例如"a=1&a=2",则生成数组$a,两个元素分别为1,2


技术大类 » PHP/JS/Shell | 评论(24) | 引用(0) | 阅读(20289)
xujie333
2012-5-21 14:43
coach outlet online Store guarantee that all the coach handbags offered are own high quality. In addition , all of them are sold at an unexpected low price.If you want to purchase, just visit their website.coach factory outlet is really sizzling kinds of shopping way for you. With the usage of the replica designer coach bags, you can surely be able to change your individual looks in a stunning manner.Coach bags on sale from the coach outlet are cheap or discount prices that you certainly will stand out from the crowd on your next camping trip!<br/>
coach88888888 Email
2012-8-13 17:28
Coach Factory Outlet offer excellent, elegant coach products in order to generate room for your new collections.They're purchased more quickly that you may at any time imagine.Most significantly, the coach designer purses of Coach Factory Online industry won't deteriorate your individual fashions at all. Rather they would immediately change your overall looks marvelously.I find it all very odd But this is no different than Coach Outlet Online any other company that has an outlet presence and really doesn’Coach Outlet Store t explain it to the customer.By the fashion, novel appearance, sophisticated technology, superior quality, Coach Outlet won domestic and international customers, their products exported to the Middle East, Southeast Asia and other regions.
baozang
2012-9-22 13:34
Lamo - Like Sebago, Louis Vuitton Canada  there are only about 40 styles of Lamo Footwear. Most of their footwear uses a suede leather traditional in True Religion Jeans  moccasins, though only about 1/3 of the footwear collection is a traditional moccasin look. True Religion Brand Jeans The rest of the collection is slippers and UGG styled boots.Louis Vuitton Artsy The traditional moccasins do have a soft rubber sole making them great deck True Religion Sale shoes as well, however. Expect to pay between $50 and $60 for Lamo moccasins.  Invicta watches have been here since 1837. They were made by Raphael Picard. Invicta watches got its name from a Latin word. The meaning of Invicta in Louis Vuitton Monogram Vernis Alma BB Amarante Latin is "Invincible". Earlier these watches were not so popular but recently with its new men's collection this watch brand has gained a lot of popularity. Watches for many are a style statement and so they prefer to own the best piece. Invicta watches are popular as they are like a style statement.
fhgh Email Homepage
2012-9-27 08:57
The specific resources that are Karen Millen dresses utilized for developing these outside jackets are on the most effective as well as the most significant best quality. The climate resistant resources aid to create your coat a instead beneficial factor, which you'll have the ability to place on all through at any time in the day.Barbour coats are possibly probably the most trendy design equipment, which you merely can not overlook to buy. Consequently, Karen Millen dress within the occasion you swear via the existing design tendencies then it is ideal to positively choose an superb top quality coat produced by this model. It is feasible to place on these leather-based coats with Karen Millen Ireland slim pants or chinos and also an normal trouser. concerning comfort and design, these outside jackets are top the charts. The amazing designs and sorts from, which you might purchase these outside jackets, are provided in countless distinct colors.
分页: 2/2 第一页 上页 1 2 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]