Jump to content

Removing Characters


mcmuney

Recommended Posts

Here is 2 easy examples of how to remove everything after a certain character

 

<?php
$string = "A blagh blah blah blah blah.  http://blah.com";
$removed = explode("http://", $string);
$removed = $removed[0];
echo $removed."<br />";

$removed2 = substr($string, 0, strpos("$string*", "http://"));
echo $removed2;
?>

Link to comment
https://forums.phpfreaks.com/topic/259774-removing-characters/#findComment-1331435
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.