020 555 1111
  • Old fashion, modular, procedural PHP plus some scaffolding techniques to allow it to mimic MVC simplicity.
  • A quick reference to help you find in PHP maze what needs to be done and how to do it.
  • Learn a PHP Object Oriented Programming by building a live discussion forum application.
  • MVC - Model View Controller - real life, easy reference and application.
This product has options, take a look at them and select ones you like the most.
Options are displayed under image section.
Top » PHP » misc

find and replace last character in string
[php misc]

//find last element in a string
substr($string, -1)

//remove last element in a string
substr_replace($string,"",-1)

 

also in one line

$toberemoved = '&'; //could be some other character
$string = 'type=filesize&sort=asc&';
((substr(trim($string), -1)==$toberemoved)?substr_replace(trim($string),"",-1):trim($string));