Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php remove after character

$s = 'Posted On April 6th By Some Dude';
echo strstr($s, 'By', true); // Posted On April 6th
Comment

php remove everything after character

$fullpath = 'folderName/file.ext';
$folder = substr($fullpath, 0, strpos($fullpath, '/'));
echo $folder;
// Output => folderName
Comment

php remove everything after a specific character

$str = 'Posted On April 6th By Some Dude';
echo strtok($str, 'By'); // Posted On April 6th
Comment

php remove everything after symbol

$variable = substr($variable, 0, strpos($variable, "By"));
Comment

PREVIOUS NEXT
Code Example
Php :: php time ago 
Php :: get data in array formate in Laravel 
Php :: item count in cart quantitiy woocommerce 
Php :: php float round 
Php :: twig get array key name 
Php :: lluminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 - your php version (8.0.10) does not satisfy that requirement. 
Php :: php pdo check if update query successful 
Php :: update query in codeigniter using where condition 
Php :: random 6 digit number php 
Php :: wp redirect 
Php :: db raw update laravel 
Php :: Str laravel 9 
Php :: wordpress custom post type add post_tag 
Php :: convert numeric array to string array php 
Php :: php get value from url 
Php :: image storage storepublicy in laravel 
Php :: brew downgrade php 8 to 7.4 
Php :: php year from date 
Php :: how to go to another folder in php 
Php :: codeigniter 3 send email smtp 
Php :: wc php get product permalink 
Php :: curl in laravel 
Php :: supervisor configuration for laravel queue 
Php :: php cut string 
Php :: set session in laravel 
Php :: laravel unique column except self 
Php :: get 2 days before date in php 
Php :: laravel migration folder 
Php :: php not recognized internal external command 
Php :: string remove last two characters php 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =