我是靠谱客的博主 等待仙人掌,最近开发中收集的这篇文章主要介绍PHP ?????? ??????,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

????????????\??????\\,\",\$
????????8??????16???????????? \xf6
echo "H\xf6me";//????????????????????????????
---------------------????????----------------------------------------
H?me
---------------------------------------------------------------------
1.????printf()??sprintf()????????????????
printf()????????????????????
sprintf()????????????????????
??printf("???????? %.2f\n",$PI());
??????????????????%????
??????????d-????,s-??????,f-??????,b-??????
.2????????????????????????????????????????0????
printf("%.2f",3.14159);
printf("%10.2f",3.14159);
printf("%.10f",3.14159);
printf("%.9s",abcdefghijklmn);
printf("%5.2f,%f,%7.3f\m",3.14159,3.14159,3.14159);
printf("%b %d %f %s \n",123,123,123,"test");
---------------------????????----------------------------------------
3.14 3.143.1415900000abcdefghi 3.14,3.141590, 3.142\m1111011 123 123.000000 test
---------------------------------------------------------------------
2.??????????
string str_pad(string input????????, int length??????????????[, string padding???????????? [, int pad_type]????????])
????????????????????STR_PAD_LEFT??????????????????????????STR_PAD_BOTH
$index = array("one"=>1,"two"=>155,"three"=>1679);
echo "
";
echo str_pad("????????",50," ",STR_PAD_BOTH)."\n";
foreach($index as $inkey=>$inval)
echo str_pad($inkey,30,".").str_pad($inval,20,".",STR_PAD_LEFT)."\n";
echo "
";
---------------------????????----------------------------------------


????????
one..............................................1
two............................................155
three.........................................1679


---------------------------------------------------------------------
string strtolower(string subject)//??????????
string strtoupper(string subject)//??????????
string ucfirst(string subject)//??????????
string ucwords(string subject)//??????????????????
string ltrim(string subject)//????????
string rtrim(string subject)//????????
string trim(string subject)????????????????????null,????????????????????????????
string n12br(string source)//??\n??????????????????
????
3.??????????
integer strcmp(sting str1,string str2) //str1????str2????-1 str1????str2????1 str1??str2????????0
integer strmcmp(sting str1,string str2,integer length) //??????????????length????????????
print strcmp("aardvark","aardwolf");
print strncmp("aardvark","aardwolf",4);
---------------------????????----------------------------------------
-10

---------------------------------------------------------------------
strcasecmp()??strncasecmp()????????????????????????
4.??????????????????
string substr(sting source,integer start[,integer length])//??start??????length??????
start??length????????????
$var = "abcdefgh";
print substr($var,2);//??0????????
print substr($var,2,3);
print substr($var,-1);//??????????????????
print substr($var,-5,2);
print substr($var,-5,-2);
---------------------????????----------------------------------------
cdefgh
cde
h
de
def

---------------------------------------------------------------------
integer strpos(string haystack,string needle[,integer offset])//??????????????????????????????????.
integer strrpos(string haystack,string needle)//????????????????????????????????????????????????????????????.
???????????? ?????????????????????? ??????
string strstr(string haystack,string needle)//????????????
string stristr(string haystack,string needle)//??????????
string strrchr(string haystack,sting needle)
*********** array explode(string separator,string subject[,integer limit])//??????????????????
array implode(string glue,array pieces)//??????????????
///////////////////////////??????////////////////////////////////////////
$guest = "this is a string";
$guestArray = explode(" ",$guest);
var_dump($guestArray);
sort($guestArray);
echo implode(",",$guestArray);
////////////////////////////////////////////////////////////////////////
---------------------????????----------------------------------------
array(4) { [0]=> string(4) "this" [1]=> string(2) "is" [2]=> string(1) "a" [3]=> string(6) "string" } a,is,string,this
---------------------------------------------------------------------
5.??????????????????
string substr_replace(string source,string replace,int start[,int length])

最后

以上就是等待仙人掌为你收集整理的PHP ?????? ??????的全部内容,希望文章能够帮你解决PHP ?????? ??????所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(136)

评论列表共有 0 条评论

立即
投稿
返回
顶部