Answers for "cut string after word php"

PHP
2

cut string in php

$string = subtr($your_string, 0, 30);
// 0 where you start to remove
// 30 where you stop remove
Posted by: Guest on December-11-2021
3

php remove everything after character

$fullpath = 'folderName/file.ext';
$folder = substr($fullpath, 0, strpos($fullpath, '/'));
echo $folder;
// Output => folderName
Posted by: Guest on March-10-2020
1

get words after string in in php

$string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla felis diam, mattis id elementum eget, ullamcorper et purus.";
$prefix = "Nulla";
$index = strpos($string, $prefix) + strlen($prefix);
$result = substr($string, $index);
Posted by: Guest on October-20-2020

Browse Popular Code Answers by Language