Jump to content

need a little help here!!!


wiegs

Recommended Posts

Something like this should work:

[code]$s = "test2345.gif";

function getnumbers($str) {
    $ret = "";
    for ($i = 0; $i <= strlen($str); $i++) {
        if (is_numeric($str{$i})) {
            $ret .= $str{$i};
        }
    }
    return $ret;
}

echo getnumbers($s);[/code]
Link to comment
https://forums.phpfreaks.com/topic/5133-need-a-little-help-here/#findComment-18235
Share on other sites

[!--quoteo(post=355806:date=Mar 16 2006, 09:50 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 16 2006, 09:50 PM) [snapback]355806[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Something like this should work:

[code]$s = "test2345.gif";

function getnumbers($str) {
    $ret = "";
    for ($i = 0; $i <= strlen($str); $i++) {
        if (is_numeric($str{$i})) {
            $ret .= $str{$i};
        }
    }
    return $ret;
}

echo getnumbers($s);[/code]
[/quote]


this worked great. thanks!
Link to comment
https://forums.phpfreaks.com/topic/5133-need-a-little-help-here/#findComment-18238
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.