How to get a part of a string from MySQL? -


i have table row

id  |  text  1   |  {"category_layout":"","image":"images\/icon-48-info.png"} 

how can image path text inside brackets?

what need this: images/icon-48-info.png (note there 2 slashes in text \ / while need 1 /

edit: simple, , found nice solution:

$json = $row->text; $obj = json_decode($json); echo $obj->{'image'}; 

no need regexp or else.

read string functions reference, try using regexp or substring_index


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -