resource mysql_pconnect ([ string $server = ini_get(“mysql.default_host”) [, string $username = ini_get(“mysql.default_user”) [, string $password = ini_get(“mysql.default_password”) [, int $client_flags ]]]] ) Establishes a persistent connection to a MySQL server. mysql_pconnect() acts very much like mysql_connect() with two major differences. First, when connecting, the function would first try to find a (persistent) link that’s already …
Category Archives: PHP
WP Increasing memory allocated to PHP
Also released with Version 2.5, the WP_MEMORY_LIMIT option allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as “Allowed memory size of xxxxxx bytes exhausted”. This setting increases PHP Memory only for WordPress, not other applications. …
ORDER BY using specific order from IN
You can use FIND_IN_SET to do that: SELECT * FROM tablename WHERE id IN (1,10,8,5) ORDER BY FIND_IN_SET(id, ‘1,10,8,5’)
php DATE_RFC822
<?php echo(“Result with date():<br />”); echo(date(“l”) . “<br />”); echo(date(“l dS \of F Y h:i:s A”) . “<br />”); echo(“Oct 3,1975 was on a “.date(“l”, mktime(0,0,0,10,3,1975)).”<br />”); echo(date(DATE_RFC822) . “<br />”); echo(date(DATE_ATOM,mktime(0,0,0,10,3,1975)) . “<br /><br />”); echo(“Result with gmdate():<br />”); echo(gmdate(“l”) . “<br />”); echo(gmdate(“l dS \of F Y h:i:s A”) . “<br />”); echo(“Oct …
PHP remove custom tags strip_tags
<?php $text = ‘<p>Test paragraph.</p><!– Comment –> <a href=”#fragment”>Other text</a>’; echo strip_tags($text); echo “\n”; // Allow <p> and <a> echo strip_tags($text, ‘<p><a>’); ?>
PHP Automatic Login Using Curl
If you’are lazy people like me. This script may help u. This script is to automated our login to some site.You must have cURL installed to use this script.