I need to have an underscore for any space in the last part of this address returned from a mysql table. The problem is I don’t think I can just modify the SQL in the model because I need to have the original values with spaces returned in the value="<?php echo $row['brand'];?>" portion as well. I am just starting to learn php/html so not sure if this is possible. Here is the portion of the code from the view that I need to modify.
<?php foreach($rb_data as $row){ ?>
<input type="button" class="btn btn-success" value="<?php echo $row['brand'];?>" onClick="document.location.href = ('http://localhost/CodeIgniter_2.1.2/index.php/controller/community/<?php echo $row['brand'];?> ' );">
<?php } ?>
For example when I click on the button that says Our Family I need it to return CodeIgniter_2.1.2/index.php/controller/community/our_family
all lowercase is preferred but not necessary. Any help is appreciated.
if you only need to replace spaces you could do something like that.