How to convert pascal case decode in php?

In this post, We will show you how to convert pascal case decode.

1. Code:

<?php 
	function convertPascalCaseDecode($str){
		$res = '';
		for ($i = 0; $i < strlen($str); $i++) {
			$ch = $str[$i];
			if (ctype_upper($ch)) {
				$res .= " $ch";
			} else {
				$res .= $ch;
			}
		}
		return ucfirst(trim(strtolower($res)));
	}
      $str = "soltuts.comIsProvidingPhpTutorials";
      echo convertPascalCaseDecode($str);
    ?> 

2. Example:

Input:

"soltuts.comIsProvidingPhpTutorials"

Output:

Soltuts.com is providing php tutorials