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

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -