well
$string = 'something ending in 3'
$n = 3;
if( preg_match( '/'.$n.'$/', $string ){
//do something
}
ought to do it[edit: but im sure there's a more efficient way... i just can't be arsed to think, sorry :)]
( ,
Wed 22 Jan 2003, 22:18,
archived)
$n = 3;
if( preg_match( '/'.$n.'$/', $string ){
//do something
}
ought to do it[edit: but im sure there's a more efficient way... i just can't be arsed to think, sorry :)]
actually...
dur...
$n=4;
$string = "blahblah4";
if( $string{strlen($string)+1} = $n ){
//do summat
}
that'll be a bit more efficient
( ,
Wed 22 Jan 2003, 22:29,
archived)
$n=4;
$string = "blahblah4";
if( $string{strlen($string)+1} = $n ){
//do summat
}
that'll be a bit more efficient