Hi.
I am building a tiny CMS. I want the client to add pictures to a text easily without any HTML knowledge. The syntax should be like this:
(picture:filename.jpg, optional title)
Before the page is published, PHP replace the tags:
preg_replace('/(picture🙁.),(.))/Uis', '<img src="$1" title="$2" />');
If no comma is given, the replacement of course doesn't work. How can I tell replacement that comma and title are optional?
Thank you for any help!
Please don't hate me because of my bad pattern syntax...