Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

substr function

$
0
0

Hi im trying to use the substr function in php. I have a string called $finalString and im trying to grab the last character of that string the line of code im using is :

 

$startIndex = substr($finalString, -1);

 

it wont work giving the error : 

 

Warning: substr() expects parameter 2 to be long, string given in /users/2017/bfm3/public_html/cs1109/lab10/markovnew.php on line 34


Viewing all articles
Browse latest Browse all 13200

Trending Articles