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 :: string to float php 
Php :: insert php mysql 
Php :: php search on array 
Php :: change php max upload size 
Php :: bitrix is admin 
Php :: laravel where creation is today carbon 
Php :: check session in blade laravel 
Php :: wordpress check if current page is front page 
Php :: php remove first and last char 
Php :: composer memory limit 
Php :: php redirect to another page 
Php :: php artisan migrate reset 
Php :: carbon parse sunday 30 days ago 
Php :: if name value contains space in php 
Php :: get current month record in laravel 
Php :: wait php 
Php :: php set header content type html 
Php :: wordpress on publish hook 
Php :: yii1 set flash 
Php :: php date strtotime add days 
Php :: regex for email php 
Php :: dynamic alert php 
Php :: php artisan make controller model and migration 
Php :: php round decimal 
Php :: Laravel validation for checkboxes 
Php :: php remove last character from string 
Php :: if post id is wordpress php 
Php :: how to do laravel in sidebar active menu dynamic blade 
Php :: php shorthand if isset 
Php :: convert 1 digit to five digits laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =