Pramod T P

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

Daily Archives: April 19, 2011

Wordpress

How to get the email address of the site admin – WordPress

April 19, 2011 Pramod T P Leave a comment
<?php 
 echo bloginfo('admin_email');
 // admin email
?>
BloginfoPHPWordpress
Wordpress

How to get the theme url – WordPress

April 19, 2011 Pramod T P Leave a comment
<?php 
 echo bloginfo('stylesheet_directory');
 // Theme path
?>
BloginfoPHPWordpress
PHP

Remove spaces from the beginning and end of a string – PHP

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

echo trim("  Test "); // Test

//Will remove the spaces from the beginning and end
?>
PHPString functions
Wordpress

Function that displays the categories – WordPress

April 19, 2011 Pramod T P Leave a comment
<?php 
 wp_list_categories();  
 // List all categories
?>
CategoryPHPWordpress
PHP

How to read all the keys or a subset of the keys of an array – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $testArray = array(1 => 5, "name" => "First Name");
 print_r(array_keys($testArray));
 //Array ( [0] => 1 [1] => name )
?>
ArrayPHPString functions
PHP

Check whether a variable is empty – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 // Example 1
 $string="";
 if(empty($string))
  echo "Empty string";
 else
  echo "Not an empty string"; //Empty string
?>

<?php
 // Example 2
 $strng="Test";
 if(empty($strng))
  echo "Empty string";
 else
  echo "Not an empty string";  //Not an empty string
?>
PHPString functions
PHP

Check whether a variable is empty – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 // Example 1
 $string="";
 if(empty($string))
  echo "Empty string";
 else
  echo "Not an empty string"; //Empty string
?>

<?php
 // Example 2
 $strng="Test";
 if(empty($strng))
  echo "Empty string";
 else
  echo "Not an empty string";  //Not an empty string
?>
PHPString functions
PHP

Add backslashes in front of special characters – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $str = "Test's";
 echo addslashes($str); //Test's
?>
PHPString functions
PHP

Removes backslashes – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $str = "Test's";
 echo stripslashes($str); //Test's
?>
PHPString functions
PHP

Converts characters to HTML entities – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $str = "<p>First Name</p>";
 echo htmlentities($str); //<p>First Name</p>
?>
PHPString functions

Posts navigation

← Previous 1 2 3 Next →

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.
Pramod T P
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
 

Loading Comments...