I have a string like:
#05#, #45#, #785# ...etc
#05#, #45#, #785#
I need to remove the hash symbols from either side of each id value so that #01544# becomes 01544.
#01544#
01544
Use this:
preg_replace('(#([0-9]+)#)', '\1', '#05#, #45#, #785#');