Jump to content

string manipulation...


mkosmosports

Recommended Posts

Thanks boo lolly. That works.

 

Ive created another method though that doesnt require creating arrays (I need strings in the end anyways).

 

Here it is using the below string:

 

        $string1 = '100-500';

 

$lowval = substr("$string1",0,strpos("$string1","-")); //Number before -

$highval = substr(strstr("$string1","-"),1); //Number after -

Link to comment
https://forums.phpfreaks.com/topic/51581-string-manipulation/#findComment-254043
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.