Pramod T P

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

Daily Archives: May 22, 2012

PHP

strnatcmp()

May 22, 2012 Pramod T P

It compares two strings using a “natural” algorithm.

Example

<?php
echo strnatcmp(“PHPCode”,”PHPCodez”);
?>

Output

-1

FunctionsPHPString
PHP

strnatcasecmp()

May 22, 2012 Pramod T P

It compares two strings using a “natural” algorithm.

Example

<?php
echo strnatcasecmp(“PHPCode”,”PHPCodez”);
?>

Output

-1

FunctionsPHPString
PHP

strlen()

May 22, 2012 Pramod T P

It find the string length

Example

<?php
echo strlen(‘info@phpcodez.com’);
?>

Output

17

FunctionsPHPString
PHP

stristr()

May 22, 2012 Pramod T P

It find the first occurrence of a string(case insensitive)

Example

<?php
echo stristr(‘info@phpcodez.com’, ‘@’, true);
?>

Output

info

FunctionsPHPString
PHP

stripslashes()

May 22, 2012 Pramod T P

It removes backslashes added by the addslashes() function.

Example

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

Output

phpcode

FunctionsPHPString
PHP

stripos()

May 22, 2012 Pramod T P

It returns the position of the first occurrence of a string inside another string

Example

<?php
echo stripos(“phpcode”,”code”);
?>

Output

3

FunctionsPHPString
PHP

stripcslashes()

May 22, 2012 Pramod T P

It removes backslashes added by the addcslashes() function

Example

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

Output

phpcode

FunctionsPHPString
PHP

strip_tags()

May 22, 2012 Pramod T P

It  strips HTML and PHP tags from a string

Example

<?php
echo strip_tags(“

phpcode

“);
?>

Output

phpcode

FunctionsPHPString
PHP

strcspn()

May 22, 2012 Pramod T P

It returns the number of characters found in a string before any part of the specified characters are found.

Example

<?php
echo strcspn(“phpcode”,”c”);
?>

Output

3

FunctionsPHPString
PHP

strcoll()

May 22, 2012 Pramod T P

It compares two strings based on locale setting

Example

<?php
echo strcoll(“phpcode”, “PHPCode”);
?>

Output

1

FunctionsPHPString

Posts navigation

1 2 … 6 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
Create a free website or 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...