2tonejoe Posted August 4, 2008 Share Posted August 4, 2008 is there a way to make a new variable with just certain parts of a string based on a given range. . . ? something like this in python? var = "This" newVar = var[0:2] print newVar Th Link to comment https://forums.phpfreaks.com/topic/118016-solved-index-of-string/ Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 Yes, using substr(). Link to comment https://forums.phpfreaks.com/topic/118016-solved-index-of-string/#findComment-607082 Share on other sites More sharing options...
MasterACE14 Posted August 4, 2008 Share Posted August 4, 2008 <?php $var = "This" $newVar = substr($var,2); print $newVar; ?> Th Link to comment https://forums.phpfreaks.com/topic/118016-solved-index-of-string/#findComment-607124 Share on other sites More sharing options...
2tonejoe Posted August 4, 2008 Author Share Posted August 4, 2008 Yes, using substr(). awesome! Link to comment https://forums.phpfreaks.com/topic/118016-solved-index-of-string/#findComment-607129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.