Page 1 of 1

string manipultion

Posted: Wed Mar 23, 2005 9:32 am
by dannymc1983
anyone know how to insert characters at the front of a string? say for example if i had the string "cde" and wanted to insert the charachters 'a' and 'b' at the front to make it "abcde".
i know array_push will insert charcters but it puts them at the end. anyone know of a function that will do what im trying to do?

Posted: Wed Mar 23, 2005 9:34 am
by Chris Corbyn

Code: Select all

$string = 'cde';
$appender = 'ab';
$newstring = $appender.$string;