Skip to Content

PHP preg_match function

ramez.hanna's picture

i want to parse the string "_0_ _1_ _2_ _3_" to get the numbers in an array

i could do that for a fixed string but if the string is a variable in length i can't figure out how to do it but this won't repeat it self i.e it can't do the job if the string becomes "_0_ _1_ _2_ _3_ _4_ _5_" i need help

Alaa's picture

use implode

cheers,
Alaa


ramez.hanna's picture

thanks for the tip

thanks for the tip i did //explode(' ', str_replace("_", "", $usersstring->chusers)) and it worked just fine


the best things in life are free --- so as myself

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Dr. Radut | forum