PHPCodez

Search
Skip to content
  • PHP
  • Magento
  • Javascript
  • HTML
  • My SQL
  • Functions
  • WordPress
  • Plugins
  • Joomla
  • Linux
  • jQuery
  • Profile
  • comments
PHP

Convert array into string – PHP

April 14, 2011 Pramod T P Leave a comment
<?php
 $testArray = array('Test1', 'Test2', 'Test3');
 $testString = implode(",", $testArray);
 echo $testString; // Test1,Test2,Test3
?>
ArrayPHPString functions
PHP

Remove null values from an array – PHP

April 14, 2011 Pramod T P Leave a comment
<?php
 $testArray = array('Test1', 'Test2', '');
 print_r( array_filter($testArray));
 //  Array ( [0] => Test1 [1] => Test2 )
?>
ArrayPHPString functions
PHP

Remove duplicate entries from an array – PHP

April 14, 2011 Pramod T P Leave a comment
<?php
 $testArray = array('Test1', 'Test2', 'Test1');
 print_r( array_unique($testArray));
 //  Array ( [0] => Test1 [1] => Test2 )
?>
ArrayPHPUbuntu
PHP

Find out the number of elements in an array – PHP

April 14, 2011 Pramod T P Leave a comment
<?php
 $testArray = array('Test1', 'Test2', 'Test1');
 echo( count($testArray));  // 3
 echo( sizeof($testArray)); // 3
?>
ArrayPHPString functions
PHP

Find out the length of a string – PHP

April 14, 2011 Pramod T P Leave a comment
<?php
 echo $length = strlen("Efforts"); // 7
?>
PHPString functions
PHP

Find out the IP address – PHP

April 12, 2011 Pramod T P Leave a comment
<?php
 echo $_SERVER['REMOTE_ADDR']
?>
PHP
PHP

Find out the previous page – PHP

April 12, 2011 Pramod T P Leave a comment
<?php
 echo $_SERVER['HTTP_REFERER']
 //will return the previous page
?>
PHP
PHP

How to find out the difference between two given dates – PHP

April 12, 2011 Pramod T P 1 Comment
<?php
 $startDate=explode("-", "02-08-2010");
 $endDate=explode("-", "26-04-2007");
 echo gregoriantojd($startDate[1], $startDate[0], $startDate[2])
     -  gregoriantojd($endDate[1], $endDate[0], $endDate[2]);
 //1194
?>
DatePHP
PHP

How to disable error reporting in php?

April 11, 2011 Pramod T P Leave a comment
<?php
 error_reporting(0);// Will not report any error
 error_reporting(-1);// Shows all errors
?>
PHPUbuntu
PHP

Limits the maximum execution time – PHP

April 11, 2011 Pramod T P Leave a comment
<?php
 set_time_limit(2); //
 // If the value is  "0" , it will rum for unknown time
?>
PHPTime

Posts navigation

← Previous 1 … 98 99 100 Next →

Beginners' Guide

Recent Posts

  • Constructor Property Promotion
  • Named Arguments
  • Customer Attributes
  • Payment Method Facade
  • Content Staging
  • AMQP Components
  • AMQP
  • Last Day Of The Month PHP
  • PHP Previous Date

Recent Comments

  • سجّل الآن واحصل على 100 USDT on Escape Output
  • Binance Cadastro on Magento 2 Remove Header
  • 파워볼사이트 on XAMP Change Localhost To Domain
  • google on Include a block in sidebar – Magento
  • moving company los angeles on Include a block in sidebar – Magento

Categories

  • .htaccess (32)
  • Ajax (4)
  • Apache (43)
  • AWS (11)
  • Cookie (4)
  • Database Model (9)
  • Design Pattern (9)
  • Filter (27)
  • General (186)
  • HTML (5)
  • IP.Board (1)
  • Javascript (99)
  • Jetty (3)
  • Joomla (17)
  • jQuery (63)
  • JSON (3)
  • JSP (1)
  • Linux (121)
  • Magento (366)
  • My SQL (74)
  • nginx (4)
  • OOPs (12)
  • Payment Gateway (1)
  • PHP (996)
  • Plugins (11)
  • Prototype (1)
  • session (5)
  • Socialengine (1)
  • SQL (69)
  • SVN (17)
  • Uncategorized (11)
  • Vbulletin (11)
  • Wordpress (89)
Proudly powered by WordPress