Pramod T P

Search
Skip to content
  • Home
  • PHP
  • WordPress
  • Linux
  • Magento
  • My SQL
  • Profile
  • comments

Daily Archives: April 28, 2011

PHP

Remove the first and last item of the array – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 $sampleData = array('10', '20', '30.30', '40', '50');
 array_shift($sampleData);
 array_pop($sampleData);
 print_r($sampleData); // Array ( [0] => 20 [1] => 30.30 [2] => 40 )
?>
PHPString functions
PHP

Remove the first element of an array – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 $sampleDate = array("Test1", "Test2", "Test3", "Test4");
 array_shift($sampleDate);
 print_r($sampleDate); // Array ( [0] => Test2 [1] => Test3 [2] => Test4 ) .
 // Test1 will be shifted
?>
PHPString functions
PHP

Remove the last element of an array – PHP

April 28, 2011 Pramod T P 1 Comment
<?php
 $sampleDate = array("Test1", "Test2", "Test3", "Test4");
 array_pop($sampleDate);
 print_r($sampleDate); // Array ( [0] => Test1 [1] => Test2 [2] => Test3 ) .
 // Test4 will be removed
?>
PHPString functions
PHP

Replace string with another string – PHP

April 28, 2011 Pramod T P Leave a comment
<?php 

$name 	=	"Hello Name";	

$name =str_replace("Name", "First Name", $name);

echo $name;  // Hello First Name 

?>
PHPString functions
PHP

Convert the first character of each word in a string into uppercase – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo ucwords("hello name"); // Hello Name
?>
PHPString functions
PHP

Convert the first letter into lower case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo lcfirst("Name"); // name
?>
PHPString functions
PHP

Convert the first letter into uppercase – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo ucfirst("name"); //Name
?>
PHPString functions
PHP

Convert the string into upper case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo strtoupper("name"); // Name
?>
PHPString functions
PHP

Convert the string into lower case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo strtolower("FIRST NAME") //first name
?>
PHPString functions

Posts navigation

← Previous 1 2

Zend | Magento Certified PHP | eCommerce Architect

For Latest Updates
Visit phpcodez.com

Categories

Recent Posts

  • Regular expression
  • preg_match
  • Redirect root domain to a subdomain .htaccess
  • Redirect root domain to a subfolder .htaccess
  • Force SSL htaccess
April 2011
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  
« Mar   May »

Recent Comments

togel online's avatartogel online on How to terminate the current s…
business funding's avatarbusiness funding on compare two strings – ja…
unsecured loans uk's avatarunsecured loans uk on Function to add an element int…
treating back pain's avatartreating back pain on Submit HTML form to pop up pag…
Pura Cleanse's avatarPura Cleanse on Add the block "Based on y…
  • RSS - Posts
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Pramod T P
    • Already have a WordPress.com account? Log in now.
    • Pramod T P
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar