Pramod T P

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

Daily Archives: May 23, 2012

PHP

vsprintf()

May 23, 2012 Pramod T P

It return a formatted string

Example

<?php
echo vsprintf(“%s %s”,array(“php”,”code”));
?>

Output

php code

FunctionsPHPString
PHP

vprintf()

May 23, 2012 Pramod T P

It output a formatted string

Example

<?php
vprintf(“%s %s”,array(“php”,”code”));
?>

Output

php code

FunctionsPHPString
PHP

vfprintf()

May 23, 2012 Pramod T P

It writes a formatted string to a specified output stream

Example

<?php
$file = fopen(“test.txt”,”w”);
echo vfprintf($file,”%s%s”,array(“PHP”,”Code”));
?>

Output

7

FunctionsPHPString
PHP

ucwords()

May 23, 2012 Pramod T P

It converts the first character of each word in a string to uppercase

Example

<?php
echo ucwords(“php code”);
?>

Output

Php Code

FunctionsPHPString
PHP

ucfirst()

May 23, 2012 Pramod T P

It  make a string’s first character uppercase

Example

<?php
echo ucfirst(“phpcode”);
?>

Output

Phpcode

FunctionsPHPString
PHP

trim()

May 23, 2012 Pramod T P

It strips whitespace from the beginning and end of a string

Example

<?php
echo trim(” php code “);
?>

Output

php code

FunctionsPHPString
PHP

substr()

May 23, 2012 Pramod T P

It returns part of a string

Example

<?php
echo substr(“phpcode”,2,4);
?>

Output

pcod

FunctionsPHPString
PHP

substr_replace()

May 23, 2012 Pramod T P

It replace text within a portion of a string

Example

<?php
echo substr_replace(“php code”,”codez”,4);
?>

Output

php codez

FunctionsPHPString
PHP

substr_count()

May 23, 2012 Pramod T P

It counts the number of substring occurrences

Example

<?php
echo substr_count(“phpcode. phpcodez”,”code”);
?>

Output

2

FunctionsPHPString
PHP

substr_compare()

May 23, 2012 Pramod T P

It compares two strings from a specified start position

Example

<?php
echo substr_compare(“phpcodexc”,”phpcode”,0);
?>

Output

2

FunctionsPHPString

Posts navigation

← Previous 1 … 4 5 6 7 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
May 2012
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Apr   Jun »

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...