laravel take two last char on variable code example Example: take last four digits php $newstring = substr($dynamicstring, -7);