Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sub() vs substr in php

<?php
$rest = substr("abcdef", -1);    // returns "f"
$rest = substr("abcdef", -2);    // returns "ef"
$rest = substr("abcdef", -3, 2); // returns "de"
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #substr #php
ADD COMMENT
Topic
Name
2+3 =