Answers for "cut string php after word"

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

Browse Popular Code Answers by Language