First, I'm going to do a sanity check strlen so we've used string length, strlen, before.
首先,我先做一个检查,我们以前使用过字符串长度函数。
But, if you also wanted to use the standard PHP strlen function (say, within your own strlen implementation), you'd need to precede the function invocation with a backslash, as Listing 10 shows.
但是,如果也希望使用标准的PHP strlen函数(比如在自己的strlen实现内部),就需要在函数调用前面加上反斜杠,见清单10。
Calling isset happens to be faster then strlen because unlike strlen , isset is a language construct and not a function meaning that it's execution does not require function lookups and lowercase.
调用isset恰巧比strlen快,因为与后者不同的是,isset作为一种语言结构,意味着它的执行不需要函数查找和字母小写化。
It turns out there's a new function strlen S-T-R-L-E-N that you probably have not used yet called strlen, S-T-R-L-E-N, programmers early on and still like to be succinct but communicates sufficiently what they mean.
结果这里有个新的函数,你可能没有使用过,叫做,早期的和现在的程序员喜欢简洁地,但是能充分的传达他们的意思。
First, I'm going to do a sanity check strlen so we've used string length, strlen, before.
首先,我先做一个检查,我们以前使用过字符串长度函数。
I certainly don't want to assume they're always going to type a three-letter or a four-letter or a two-letter word I want some dynamism but that's fine because get string can get a string of any length, I can then use the string length function to just ask while the program is running how big is the string that I was handed?
当然我不能假设他总是,输入3个字符或4个字符,或2个字符的单词,我想要动态地分配,因为GetString可以获得任意长度的字符串,然后我可以使用strlen函数,来得到那个我传递的字符串,有多长?
应用推荐