format variable inside list

hi, i have a question how to format variable inside list and print them to a template. i want to install php with memcache, so i have php servers group and memcache servers group. in order to integrate them, i have to modify php.ini and add each of memcache server’s ip to it. so i have to modify this line
session.save_path=“tcp://10.10.250.111:11211,tcp://10.10.250.112:11211”
how to format memcache servers member group to something like that? thanks :smiley: