fivestringsurf Posted April 14, 2010 Share Posted April 14, 2010 I wrote some functions that work great locally - I have php5.3 installed. Upon uploading to my godaddy server things broke, as godaddy's server is currently running 5.2.5. my functions rely heavily upon the 3rd paramater of strstr() which is 5.3 and older feature. Is there a way i can simply copy php5.3's strstr() function and include() it as a regular custom function so i can access strstr()'s 3rd parameter while using php5.2? Link to comment https://forums.phpfreaks.com/topic/198541-access-to-php-53-function-features-on-older-installs-strstr/ Share on other sites More sharing options...
trq Posted April 15, 2010 Share Posted April 15, 2010 Is there a way i can simply copy php5.3's strstr() function and include() it as a regular custom function so i can access strstr()'s 3rd parameter while using php5.2? No. You will need to upgrade or write your own version (named something else of course). Link to comment https://forums.phpfreaks.com/topic/198541-access-to-php-53-function-features-on-older-installs-strstr/#findComment-1042126 Share on other sites More sharing options...
fivestringsurf Posted April 15, 2010 Author Share Posted April 15, 2010 upgrading is not an option, because the site is hosted at godaddy. but i actually did write my own function to emulate strstr('this','that',true); //set to true to capture data prior to needle: function myStrstrTrue($haystack,$needle){ //strstr() 3rd parameter is php5.3<= so i wrote this $haystack = (string)$haystack; $haystack = explode($needle,$haystack); //remove text after end tag and tag $haystack = (string)$haystack[0]; return $haystack; } Link to comment https://forums.phpfreaks.com/topic/198541-access-to-php-53-function-features-on-older-installs-strstr/#findComment-1042135 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.