Answers for "get string before character php"

PHP
2

get the string after a character in php

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

php remove last character from string

$hell = substr('hello', 0, -1);
Posted by: Guest on November-04-2019
0

php get string before character

$arr = explode("/", $string, 2);
$first = $arr[0];
Posted by: Guest on November-28-2020
12

javascript get first character of string

var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H
Posted by: Guest on August-01-2019

Code answers related to "get string before character php"

Browse Popular Code Answers by Language