Get characters in between 2 strings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zerandib
Forum Newbie
Posts: 16
Joined: Tue Dec 16, 2008 12:17 am

Get characters in between 2 strings

Post by zerandib »

Hello

how to get in between characters of a string!

$variable_A = "Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However should you forget your password you can request a new one which will be activated in the same way as this account."

i want to get the characters (string) between However and which

Need to get this "should you forget your password you can request a new one"

how to do such a thing?
User avatar
phpserver
Forum Newbie
Posts: 22
Joined: Mon Oct 20, 2008 2:59 am
Location: Eastleigh,Nairobi

Re: Get characters in between 2 strings

Post by phpserver »

You will need a full php script called forgot password.

Code: Select all

<?
class Forgot_password extends model
{
function lost_pass()
{
//ways to retrieve lost pass
}
}
?>
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Re: Get characters in between 2 strings

Post by ddragas »

he was asking
Need to get this "should you forget your password you can request a new one"
NOT what he needs for script.

There are several ways in accomplishing what you want to do.

Try some of this or combination of functions

pregmatch

strpbrk

strpos
substr
cavemaneca
Forum Commoner
Posts: 59
Joined: Sat Dec 13, 2008 2:16 am

Re: Get characters in between 2 strings

Post by cavemaneca »

ddragas wrote:he was asking
Need to get this "should you forget your password you can request a new one"
NOT what he needs for script.

There are several ways in accomplishing what you want to do.

Try some of this or combination of functions

pregmatch

strpbrk

strpos
substr


I think he won't stop posting new topics until someone writes his code for him
Post Reply