Solved

question about string

Posted on 2008-10-10
2
296 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
Comment Utility

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

Assisted Solution

by:Xyptilon2
Xyptilon2 earned 200 total points
Comment Utility
<?PHP

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

?>
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

763 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

8 Experts available now in Live!

Get 1:1 Help Now