Php customary representation Twitter connections

Sharing is caring!

Here’s a snappy bit of code to highlight answers to clients in twitter for instance @vivacityIT this script utilization general outflow to find and trade a dependent upon two items. Firstly it checks for a space preceding the @ image and after that checks for the space at the close of the clients name, it then takes that string and swaps it with a connection to the client twitter profile. Convenient in the event that you have a dynamic record of tweets that you need to linkify. All you have to do is change $ret to the variable the holds your string.

$ret = preg_replace(“#(^|[n ])@([^ “tnr<]*)#ise”, “‘\1<a href=”http://www.twitter.com/\2″ >@\2</a>'”, $ret);

These two lines of code make a comparable showing with respects the structure anyway they search for the http:// and www.â to figure out a connection.

$ret = preg_replace(“#(^|[n ])([w]+?://[w]+[^ “nrt<]*)#ise”, “‘\1<a href=”\2″ >\2</a>'”, $ret);
$ret = preg_replace(“#(^|[n ])((www|ftp).[^ “tnr<]*)#ise”, “‘\1<a href=”http://\2″ >\2</a>'”, $ret);

2 thoughts on “Php customary representation Twitter connections

  • You can go through the internet for finding relevant Host –
    Gator coupon codes and reviews, but it wastes your lots of
    time and effort. They also facilitate video tutorials, helps new business
    clients to find more information of online business world.
    Nowadays, various relevant websites are available, offers and reviews instantly.

  • Hi fantastic website! Does running a blog such as this require a
    large amount of work? I have virtually no expertise in coding
    however I was hoping to start my own blog soon.
    Anyways, should you have any suggestions or techniques for
    new blog owners please share. I understand this is off topic but I just needed to
    ask. Kudos!

Leave a Reply

Your email address will not be published. Required fields are marked *

Got Project on mind? Let's ConnectContact Us

Secured By miniOrange