AuthorMohit Aneja

HowTo: Extract links from HTML string with PHP

H

While working on a project I needed to extract links from HTML strings to create jobs for tracking clicks and visits etc. Here’s the function I wrote in PHP to extract the links from HTML strings in PHP. <?php public function extractLinks(string $html): array { $links_array = []; if (preg_match_all('/<a\s+.*?href=[\"\']?([^\"\' >]*)[\"\']?[^>]*>(.*?)<\/a>/i'...

HowTo: Share your local websites with others via the internet.

H
Network

We create beautiful websites on our local system, then deploy these to a demo server so others can see the updates. This approach is good when we are working with clients that need access to the demo website for review at any time they want. However, if working with different dev teams or need to do quick reviews with clients or peers, wouldn’t it be awesome if we can just share our local...

Hello World

H
Hello World Again!!

That’s the first thing we developers write to test if the installation worked fine right? However, today, it’s Hello Again!! I bought this domain back in 2007 and started sharing my knowledge, experiences and answering questions submitted in the “Ask Me Anything” section of my website. This is the first-ever WordPress theme I designed.. Back then one of my readers asked me...

Mohit Aneja

Sharing Best Practices

I love to share the knowledge and experience with like minded people. Feel free to connect with me via any preferred channel.