How to escape '/' in codeigniter, php? -


hey guys. i'm having silly issue inserting text forwardslash cart in codeigniter. when it's plain string it's fine when inserting, say, "compact / compact" it's not doing it. guess '/' needs somehow escaped. tried hmtlspecialchars(), htmlentities() , addslashes() - none of worked. know how in php?

when i'm inserting cart, i'm doing this:

$release_barcode = $this->uri->segment(3);          $release = $this->lists_model->get_release_by_barcode($release_barcode);              foreach($release $row):             {                  $barcode = $row->ean_upc;                  $price = $row->product_price;                  $currency = $row->product_currency;                  $artist_name = $row->artist_name;                  $label_name = $row->label_name;                  $release_name = $row->title;                  $cover = $row->cover;                  $item_name = $artist_name.', '.$release_name.', '.$label_name;                   $data = array(                                   'id'      => $barcode,                                   'qty'     => 1,                                   'price'   => $price,                                   'name'    => $artist_name,                                   'options' => array('pic' => $cover, 'currency' => $currency)                               );                   $this->cart->insert($data);               }             endforeach;              $this->display_cart(); 

perhaps i'm doing wrong here. can give me hint please?

$string = str_replace('/', '\/', $string);

thats works of ci applications.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -