?
Solved

question about string

Posted on 2008-10-10
2
Medium Priority
?
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
ahalya earned 1200 total points
ID: 22692740

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

Assisted Solution

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

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

?>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

771 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