Category: Regex

skpaul.me

Update – Please visit skpaul.me for latest posts and updates

DatabaseJavaScript(JS)JoomlaMagentoMySQLosCommercePHPPositive Bangladesh (পজেটিভ বাংলাদেশ)RegexUncategorizedWordpressকবিতাsk_paulskpaulskpaul.meskpaul82

Hi, Greetings!! Thanks for visiting my blog, I have open a blog (https://skpaul.me). So from now, you will get all latest posts and updates on https://skpaul.me.   Please take a look on my personal blog (https://skpaul.me), and let me know your comments and review.   Thanks in Advance sk paul https://skpaul.me

How to find src attribute of image tag in php?

PHPRegexextracthtmlimageimage srcimgphpregexsk_paulskpaul82

In my case, I had a string containing exactly one <img /> tag (and no other markup). And I was trying to get the src attribute. // get the featured image $image = ‘<img src=”path/to/image_file” />’; // get the src for that image $pattern = ‘/src=”([^”]*)”/’; preg_match($pattern, $image, $matches); $src = $matches[1]; unset($matches); In the ….  Read More