Internet Methodologies Journal And News

Let's explore internet with imran

Count HTML Tags in PHP through strlen() function

<?php

	$text = "<p>This is 'a' my first paragraph.</p><!-- Comments --> sample text text";

	echo "String Lenght of HTML chars:".strlen_noHtml($text); // 48 chars

function strlen_noHtml($string){
    $crs = 0;
    $charlen = 0;
    $len = strlen($string);
    while($crs < $len)
    {
        $offset = $crs;
        $crs = strpos($string, "<", $offset);
        if($crs === false)
        {
           $crs = $len;
           $charlen += $crs - $offset;
        }
        else
        {
            $charlen += $crs - $offset;
            $crs = strpos($string, ">", $crs)+1;
        }
    }
    return $charlen;
}
?>
  • Share/Bookmark


Count a string with including HTML Tags through strlen()


$text = "<p>This is 'a' my first paragraph.</p><!-- Comments --> sample text text";

echo "String Lenght of HTML chars:".strlen_html($text); // 24 chars

function strlen_Html($string){
    $crs = 0;
    $charlen = 0;
    $len = strlen($string);
    while($crs < $len)
    {
        $scrs = strpos($string, "<", $crs);
        if($scrs === false)
        {
           $crs = $len;
        }
        else
        {
            $crs = strpos($string, ">", $scrs)+1;
            if($crs === false)
                $crs = $len;
            $charlen += $crs - $scrs;
        }
    }
    return $charlen;
}
?>
  • Share/Bookmark


Chopaal-Pringit: Social Networking Tide In Pakistan

Do you wish to do more than just making phone calls through your mobiles, well say it out loud then because as the ‘febtastic’ month comes to an end and the era of social networking takes a completely new turn in Pakistan. Not just a mere turn but also a giant leap towards innovation.

From the rich and bright land of LUMS came Chopaal. Saving your thumbs and your credit through a new form of mobile social networking. Chopaal very interestingly brought friends together where they could easily interact through the exchange of SMS free of charge. Making itself more efficient everyday Chopaal has a new friend in the market to compete with.

An energetic group of engineers just pringed life into the mobile social networking era through ‘pringit’.

Now no matter which location you are at pringit will search you find you and connect you with your friends from your cell phone from anywhere in Pakistan. With an amazing presentation Pringit is definitely leading the way.

The simple, clear yet entertaining add attracts many- if you know your target audience then you know how to reach out to them. And pringit has just done that.

With a perfect desi presentation, the crispy pringit advert represents the youth of today in a typical Paki way. For those who find it difficult to comprehend what pringit is all about, the advert serves as a remarkable explanation, and the best part is, it is in Urdu.

Pakistan has rich innovative talent studded in its core, one idea leading to another and another to another, developing, discovering and revolutionizing the Software Industry of Pakistan.

Sources: http://www.pringit.com/

http://www.chopaal.pk/index.php

www.codeweek.pk

  • Share/Bookmark


How to find hosting server information / specifications?

Simply write single line of code and place the file on your Hosting server and access it through browser.

<?php echo phpinfo(); ?>

You will find a lot of information about your Hosting Provider Machine. Enjoy :)

  • Share/Bookmark


How to increase Memory Limit in PHP (php.ini)?

ini_set("memory_limit", "16M");
  • Share/Bookmark


Fly By – Pakistan’s First Flash Game on Facebook

Fly By has been developed by Web Sketchers, a team of individuals who graduated from FAST-NU Lahore in 2009.

Web Sketchers is proud to present the first 3D Flash web-based game to be developed in Pakistan on Facebook – Fly By

Fly By is a highly enticing game and already, they have registered more than 600 users from throughout the world. As you will see for yourself, the game is visually spectacular, rich in colors, and incorporates eye-catching 3D modeling.

Fly By is a game where the player is the pilot of a renegade aircraft on the run through the city skyline. The player has to evade high flying hot air balloons and tall standing skyscrapers to save the aircraft, earn points, and reach new levels of play. Consequently, friends can be challenged to find out who’s the best aviator in the sky! The game was officially launched on the 9th of February, 2010 on Facebook

Please use the following link on Facebook to play:

http://apps.facebook.com/flybygame

Source: http://www.codeweek.pk/2010/02/fly-by-pakistans-first-flash-game-on-facebook/

  • Share/Bookmark


How to increase Maximum Execution Time of php.ini in PHP?

You can increase Maximum Execution Time for PHP Script through following code:

ini_set("max_execution_time", "300") //300 seconds
  • Share/Bookmark


How to set SESSION COOKIE TIMEOUT in php.ini?

ini_set("session.gc_maxlifetime", $Lifetime);
or
ini_set("session.gc_divisor", "1");
or
ini_set("session.gc_probability", "1");
or
ini_set("session.cookie_lifetime", "0");
or
ini_set("session.save_path", $DirectoryPath);
  • Share/Bookmark


What is meant by Persistent Database Connection?

Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there’s already an identical persistent connection (that remained open from earlier) – and if it exists, it uses it. If it does not exist, it creates the link. An ‘identical’ connection is a connection that was opened to the same host, with the same username and the same password (where applicable).

  • Share/Bookmark


What is ‘this’ pointer / keyword in PHP5?

Here is some information about $this-> [keyword]

he this pointer is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer.

  • Share/Bookmark