PHP dose not use C/C++ style strings well C dose not use C++ style strings (in a way) either...
Because C uses arrays there is now a library for C++ with a struct named string that handles that for use... and because C/C++ (either by hand or not) uses arrays it needs a null terminater...
But in the case of PHP it dose not... There are no variable types all most anything gose...
So try this:
Code: Select all
$teststr = "lala";
echo "THIS IS $teststr";
That is it see I made a string with a variable that could be a integer or anything... It's that simmple... PHP is like C/C++ in some ways but much different in other!
want to be able to dump chars to an array and make it a string
In this case just dump the chars into the varable... There than are str_* function you can use with that varable... Download the Php Manual from
http://www.php.net if you don't have it and search str_ that will give you are the string function you can use with that variable (or any variable in PHP in that case)
Keep on coding!
Andrew