Solved

question about string

Posted on 2008-10-10
2
297 Views
Last Modified: 2012-05-05
hi experts,

 in $mysting how can I delete every thing after $badpart if found
the $badpart  also must be deleted.

regards,
0
Comment
Question by:uk1900
2 Comments
 
LVL 7

Accepted Solution

by:
ahalya earned 300 total points
ID: 22692740

$pos = strpos($mystring, $badpart);
$mystring = substr($mystring, $pos);
0
 
LVL 13

Assisted Solution

by:Xyptilon2
Xyptilon2 earned 200 total points
ID: 22692752
<?PHP

echo "Before: $sMystring <BR>";
$nPosition = strpos($sMystring, $sBadpart);
$sMystring = substr($sMystring, $nPosition );
echo "After: $sMystring <BR>";

?>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now