chmpdog Posted November 29, 2008 Share Posted November 29, 2008 Hola, Im trying to md5 encrypt an exploded string, then implode the string. And finally echo the encrypted string(seperated by ,) But I dont know where to go from this: $str = 'thing,thing2,thing3,thing4'; $change = explode(",", $str); Is there a tutorial, Thanks Link to comment https://forums.phpfreaks.com/topic/134794-solved-explode-simple-question/ Share on other sites More sharing options...
laPistola Posted November 29, 2008 Share Posted November 29, 2008 to show echo of the explode you need to define which position you want to show ie <?php echo $change[3]; ?> would output thing 3 Link to comment https://forums.phpfreaks.com/topic/134794-solved-explode-simple-question/#findComment-701918 Share on other sites More sharing options...
rhodesa Posted November 29, 2008 Share Posted November 29, 2008 you could use a foreach to loop over the elements, but i decided to use array_walk: <?php $str = 'thing,thing2,thing3,thing4'; $list = explode(",",$str); array_walk($list,create_function('&$v','$v = md5($v);')); $str = implode(",",$list); print $str; ?> Link to comment https://forums.phpfreaks.com/topic/134794-solved-explode-simple-question/#findComment-701922 Share on other sites More sharing options...
chmpdog Posted November 29, 2008 Author Share Posted November 29, 2008 cool, that works. Thank you Link to comment https://forums.phpfreaks.com/topic/134794-solved-explode-simple-question/#findComment-701926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.