PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
function code($string) {
$old = array('[ b ]', '[ /b ]'); //I have spaces in between cause the board dont display it correctly
$new = array('<b>', '</b>');
?>
I tried foreach to loop a form textarea but I get nothing
how would I create a foreach loop using ereg_replace to transfer the code to html tags from the old array -> new? I give up
=[
$old = array('[ b ]', '[ /b ]'); //I have spaces in between cause the board dont display it correctly
$new = array('<b>', '</b>');
$text = "[ b ]Sup?[ /b ]";
echo str_replace($old,$new,$text);
well I wanted to make it a function so I can use it on a textarea that will be inserted to mysql and called upon to be displayed on a page (like a blog type deal)
this is what i'm using for testing purpose (now using the str_replace with no loop):
one of those days. at the shop today I caught my carhartts on fire, lost my $60 dollar wire stripping tool and managed to get nothing accomplished. I knew better to attempt to fix any code
it was/is pure horror. the carhartts overalls are okay (thank god cause they were over 100 bucks.) I was burning body clamps under a bus so we can lift the body and I didnt feel it but i smelt the smoke (when your burning your focusing on the object your burning, if you look away you cant see where the tip of the torch is and can fire a load of hot cherries/sparks right at you)... u can tell where they were burned. who knows what happened to my wire tool (that was my baby) and I hope to find it tomorrow. Before I started this script code, I spent about an hour finding a stupid active-x installed program (called internet optimizer) and all its components to 100% get rid of it.
i tell you, i would be better off staying in bed all day today with a huge bucket beside me to pee in.