$string = "Hello World Again";
echo substr($string, 0, strrpos( $string, ' ') ); //Hello World
If the character isn’t found, nothing is echoed
More Related Contents:
- Fatal error: Switch statements may only contain one default clause (php7)
- syntax error unexpect something [closed]
- Parse error: syntax error, unexpected ‘;’ [closed]
- PHP – SSL certificate error: unable to get local issuer certificate
- How to use php serialize() and unserialize()
- Dompdf and set different font-family
- How to upload large files above 500MB in PHP [duplicate]
- Allowed memory size of X bytes exhausted
- How can I know which ‘php.ini’ file is used?
- localhost vs. 127.0.0.1 in mysql_connect()
- How to check if a file exists from a url
- How to detect shot angle of photo, and auto rotate for website display like desktop apps do on viewing?
- How to use RegexIterator in PHP
- Accessing session from TWIG template
- Interactive shell using PHP
- How to alias the name of a column in Eloquent
- Increase PHP Script Execution Time [duplicate]
- PHP: strtotime is returning false for a future date?
- How to select multiple rows from mysql with one query and use them in php
- php run once and insert twice in mysql database
- How to open file in PHP that has unicode characters in its name?
- Laravel 3 : Looking for explanation how to use the model
- Simple comet example using php and jquery
- Find out the error_log’s path
- Is there a limit when using php mail function?
- PHP Timezone List
- In PHP, how do I generate a big pseudo-random number?
- Optional parameter in the middle of a route
- Access object property with disallowed character in property name
- Sort a multidimensional array descending by subarray count and preserve first level keys