Answers for "php cut string before string"

PHP
2

php get string after character

$data = "123_String";    
$whatIWant = substr($data, strpos($data, "_") + 1);    
echo $whatIWant;
Posted by: Guest on April-27-2020
0

get substring after character php

<?php
$my_url = 'http://www.example.com/5478631';
echo substr($my_url, strrpos($my_url, '/' )+1)."\n";
?>
  // print: 5478631
Posted by: Guest on January-06-2021

Browse Popular Code Answers by Language