Computer Science, asked by rk3785086, 4 months ago

write the function of strrev() and strip ()​

Answers

Answered by Anonymous
1

Answer:

PHP | strrev() Function

Reversing a string is one of the most basic string operations and is used very frequently by developers and programmers. PHP comes with a built-in function to reverse strings.

The strrev() function is a built-in function in PHP and is used to reverse a string. This function does not make any change in the original string passed to it as a parameter.

Synatx:

string strrev($inpString)

Parameter: This function accepts a single parameter $inpString. This parameter is a string and it specifies the string which we want to reverse. If a number is passed to it instead of a string, it will also reverse that number.

Return Value: The strrev() function returns the reversed string or the number. It does not make any change to the original string or number passed in the parameter.

Examples:

Input : $string = "geeks"  

Output : skeeg  

Input : $string = 143  

Output : 341  

Below programs illustrate the strrev() function in PHP:

Program 1: PHP program to demonstrate the strrev() function when a string is passed.

What is Python strip()?

Python strip() function is a part of built-in functions available in the Python library. The strip() method removes given characters from start and end of the original string. By default, strip() function removes white spaces from start and end of the string and returns the same string without white spaces.

Similar questions