Which function in PHP returns a formatted string?
- sprintf()
- printf()
- str_format()
- format_string()
The sprintf() function in PHP is used to return a formatted string. It allows you to create formatted strings using placeholders and values, similar to printf() in C.
Loading...
Related Quiz
- What is the difference between the functions strstr() and stristr()?
- You are tasked with creating a PHP function that accepts a filename, opens the file, prints its contents, and then closes the file. How would you approach this task?
- You want to execute some code in your PHP script if a certain condition is not met. How would you do this using an else statement?
- Which of the following can be done using either echo or print in PHP?
- How can we access the data sent through the URL with the POST method?