?
Solved

question about string

Posted on 2008-10-10
2
Medium Priority
?
309 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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