Search code examples
phpstringstrip

PHP stripping strings


I would like to strip everything in a string before a - and leave what's after that. For example:

15.11-101

I want to strip 15.11 and leave 101. I've tried a few different things, but can't seem to get it working, if anyone could help me out, that'd be fantastic :)

Cheers

Leanne


Solution

  • You could use something like this:

    $result = substr($original, strpos($original, '-') + 1);