php - preg_replace to delete something in a special string -
hi tried delete in string. don't know ho make it.
my string: @trash='test1',value1='test2',@trash='test3',value2='test4'
i want delete @trash example = @trash='test1',
. perhaps important is, of course value in example above "test1" allways changing.
try following codes
echo preg_replace("/@trash='(.*?)',/", "", $string);
output
value1='test2',value2='test4'
Comments
Post a Comment