Pramod T P

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

Monthly Archives: May 2012

PHP

strstr()

May 23, 2012 Pramod T P

It finds the first occurrence of a string

Example

<?php
echo strstr(“phpcode”,”co”);
?>

Output

code

FunctionsPHPString
PHP

strspn()

May 23, 2012 Pramod T P

It returns the number of characters found in the string that contains only characters from the charlist.

Example

<?php
echo strspn(“phpcodephp”,”phpe”);
?>

Output

3

FunctionsPHPString
PHP

strrpos()

May 23, 2012 Pramod T P

It finds the position of the last occurrence of a  substring in a string

Example

<?php
echo strrpos(“phpcodeccr”,”p”);
?>

Output

2

FunctionsPHPString
PHP

strripos()

May 23, 2012 Pramod T P

It find the position of the last occurrence of a  substring in a string(case-insensitive)

Example

<?php
echo strripos(“phpcodeccr”,”c”);
?>

Output

8

FunctionsPHPString
PHP

strrev()

May 23, 2012 Pramod T P

It reverse a string

Example

<?php
echo strrev(“phpcodeccr”);
?>

Output

rccedocphp

FunctionsPHPString
PHP

strrchr()

May 23, 2012 Pramod T P

It finds the last occurrence of a character in a string

Example

<?php
echo strrchr(“phpcodeccr”,”co”);
?>

Output

cr

FunctionsPHPString
PHP

strpos()

May 23, 2012 Pramod T P

It finds the position of the first occurrence of a substring in a string

Example

<?php
echo strpos(“phpcode”,”co”);
?>

Output

3

FunctionsPHPString
PHP

strpbrk()

May 23, 2012 Pramod T P

It searches a string for any of the specified characters.

Example

<?php
echo strpbrk(“phpcode”,”co”);
?>

Output

code

FunctionsPHPString
PHP

strncmp()

May 23, 2012 Pramod T P

It compares  first n characters (case-sensitive) of a strings

Example

<?php
echo strncmp(“phpcode”,”codez”,7);
?>

Output

1

FunctionsPHPString
PHP

strncasecmp()

May 23, 2012 Pramod T P

It compares two strings

Example

<?php
echo strncasecmp(“phpcode”,”codez”,7);
?>

Output

13

FunctionsPHPString

Posts navigation

← Previous 1 … 19 20 21 … 55 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
Create a free website or 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...