Please try this:
<?
$str="The Hunger Games";
if (strtolower(substr($str,0,3)) == "the"){
$str = trim(substr($str,3)).', The';
}
echo $str;
?>
More Related Contents:
- What does \n mean [duplicate]
- Array Comparision with a string PHP
- JQuery is not working in php while loop
- Website wont display anything
- Reference: What is variable scope, which variables are accessible from where and what are “undefined variable” errors?
- Using braces with dynamic variable names in PHP
- “Cannot send session cache limiter – headers already sent” [duplicate]
- Filter/Remove rows where column value is found more than once in a multidimensional array
- How can I get the error message for the mail() function?
- How to call a MySQL stored procedure from within PHP code?
- Converting MySQL result array to JSON [duplicate]
- WampServer orange icon
- Upload 1GB files using chunking in PHP
- Doing HTTP requests FROM Laravel to an external API
- How to convert an array into an object using stdClass() [duplicate]
- How to easily consume a web service from PHP
- How to get closest date compared to an array of dates in PHP
- What is the use of ‘\G’ anchor in regex?
- PHP regular expression for strong password validation [duplicate]
- How to run single test method with phpunit?
- PHP – parsing a txt file
- Simplify PHP DOM XML parsing – how?
- Login to Google with PHP and Curl, Cookie turned off?
- Unserialize PHP Array in Javascript
- How do I remove the last comma from a string using PHP?
- Disable template caching for development in OpenCart 3
- Replacing invalid UTF-8 characters by question marks, mbstring.substitute_character seems ignored
- How do I retrieve the visitor’s ISP through PHP?
- How do i search from serialize field in mysql database?
- How to insert into MySQL using mysqli