What does %S mean in PHP, HTML or XML?

前端 未结 5 838
無奈伤痛
無奈伤痛 2021-02-01 14:55

I\'m looking at Webmonkey\'s PHP and MySql Tutorial, Lesson 2. I think it\'s a php literal. What does %s mean? It\'s inside the print_f() function i

5条回答
  •  再見小時候
    2021-02-01 15:41

    %s is a type specifier which will be replaced to valuable's value (string) in case of %s.

    Besides %s you can use other specifiers, most popular are below:

    d - the argument is treated as an integer, and presented as a (signed) decimal number.

    f - the argument is treated as a float, and presented as a floating-point number (locale aware).

    s - the argument is treated as and presented as a string.

提交回复
热议问题