• Sign Up
    • OpenID
    • Google
    • Yahoo!
    • Facebook
    • Ning
  • Discuss
  • New Topic
  • Categories
  • Forum
  • Debate
  • Languages
    • English
    • Finnish
    • Arabic
    • Italian
    • Korean
    • French
    • Chinese(Traditional)
    • Chinese(Simplified)
    • Swedish
    • Czech
    • Hindi
    • Dutch
    • Norwegian
    • Russian
    • Croatian
    • German
    • Japanese
    • Bulgarian
    • Portuguese
    • Chinese
    • Spanish
    • Greek
  • Login

Ok

Ads

affordable seo

Ask a Question



Welcome New Members!

zhangwigs

chandan...

jimmy b...

moneyma...

stacyjohn

Emile

Tiffany

CBIL360

Lawsons

christi...

meiwei

kingkhan

brendaj...

swati

sunnyjohn

conniejohn

sunnyping

fengmi

califor...

hengjiao


Hot Topics

array code column content Custom database drupal element field file form function index jquery module MySQl node page PHP query server something SQL string table theme time user VALUE way

 

 

 

Reason

 

PHP Reverse strstr() Function

Guest

Guest
This is a reverse strstr() function for PHP.

<?php
/**
*
* @author : Dennis T Kaplan
*
* @version : 1.0
* Date : June 17, 2007
* Function : reverse strstr()
* Purpose : Returns part of haystack string from start to the first occurrence of needle
* $haystack = 'this/that/whatever';
* $result = rstrstr($haystack, '/')
* $result == this
*
* @access public
* @param string $haystack, string $needle
* @return string
**/


function rstrstr($haystack,$needle)
    {
        return substr($haystack, 0,strpos($haystack, $needle));
    }
?>

You could change it to:
rstrstr ( string $haystack , mixed $needle [, int $start] )
<?php

function rstrstr($haystack,$needle, $start=0)
    {
        return substr($haystack, $start,strpos($haystack, $needle));
    }

?>


Purpose : Returns part of haystack string from start to the first occurrence of needle

I will maNUALLY submit Your site ONLy to Pr9,Pr8,Pr7,Pr6,Pr5 SOCiAL BOOKMARKiNG sites including Top 50 Web Dirctories for $11


In PHP Code/Snippet Share | 1 Reply | 3766 Views | 1 month ago
reverse strstr php
  • Report Abuse
  • Email
  • Add to Favorites

Rate Now:   1 2 3 4 Average Rating: 0.00 / 1 ratings


Replies:

Guest

Guest
I wtaend to spend a minute to thank you for this.

  • Reply to Answer
  • 1 month ago
  • Report Abuse
  • By Guest

Rate Now: 1 2 3 4 Average Rating: 0.00 / 0 ratings

Replied by Guest 1 month ago


Your Response:

Join

Login


 

Related Questions

PHP Spintax Function - The PHP Spinner!
2 Answers | 5875 Views
SELECT (function()).*;
0 Answers | 3391 Views
How do I call a class function without making an instance of the class?
2 Answers | 2400 Views
Get Function name of where function was called from?
0 Answers | 2823 Views
Is there a printf-like string function in postgresql?
0 Answers | 3710 Views
Disclaimer | Privacy Policy | Terms | ■ RSS | Sitemap | Contact Us | ■ Invite | Create your Widget | ■ Twitter | ■ Facebook
© 2013 PHPInformer. All rights reserved

PHPInformer does not evaluate or guarantee the accuracy of any PHPInformer content. Click here for the Full Disclaimer.