My function (in php) won't work properly. Well, sort of.... Anyways, I have some code that will work outside of a function, but to use it that way, I would have to hard code it a lot, it would be much easier to just call a function and pass it an arguement a bunch of times. But when I put the code into a function, the code doesn't work. Even when I don't pass it an arguement. A function still works, like I can use them to do other things, but when I put the code in there, it won't work. Now the code is this:
I pass it a number, like 12 or something, to use as the key to where it deletes the stuff. I have tried it without passing the key, but that doesn't work. Now it uses an array, now, do I need to pass it the array as an arguement?
Any help would be apprectiated.
[/code]
| Code: |
| function removeIt($j) {
$content[$j] = strtolower($content[$j]); $content[$j] = substr_replace($content[$j], '', 0, 18); $content[$j] = substr_replace($content[$j], '', -6, 5); } |
I pass it a number, like 12 or something, to use as the key to where it deletes the stuff. I have tried it without passing the key, but that doesn't work. Now it uses an array, now, do I need to pass it the array as an arguement?
Any help would be apprectiated.
[/code]
