0

hi all i've been trying to find a php function for this but couldn't find any
hope anyone here can help

i want to show only a part of string
like SELECT LEFT (0,5)... in SQL
but i want to do it in php
ie:

$string = "hello world";

$result = php_function($string, 0, 5);
echo $result; //hello

i've tried to replace the php_function with str_pad but it's not working
any idea for this problem?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by 1x4n
0

thanx edwin
while i was searching i'm trying to use str_split and it's working
but i think substr is faster :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.