Jump to content

Working on picking up letters and digits in an array


dreamkiller23

Recommended Posts

<?php

function rev_arr($arr){
$cou=count($arr);
$returned_array=array();
for($i=$cou-1;$i>=0;$i--)
{
$returned_array[]=$arr[$i];
}
echo "$returned_array";
}

$b=array(21,6,12);
$e=rev_arr($b);
echo "$e";
?>

 

Okay so what i'm trying to do is to pickup an in string like

 

$instr= aBc35k5

 

my function will putput c3 and k5

 

 

i tried working the code in revers order but that doesn't seem to help me

in string can be any series of letter and digits

 

Please help!

 

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.