Jump to content

How to escape or make '/' work in multidimensional array?


n3mesis125

Recommended Posts

Hey folks, this may be a dumb question but is it possible to use /'s in multidimensional arrays? ie:

 

<?php

$subArray .= "{'Name':'" .$name. "','Tag':'" .$row['cat_tag']. "','Children':'" .$row['cat_children']. "','Exclude':'" .$row['cat_exclude']. "','Field':'" .$row['cat_field']. "'}" .$sa_end;

?>

 

if $name has a value in it that is say H/R Express when i print $subArray into javascript such as var test = "[<? print $subArray; ?>]"; it messes up in javascript because of the /'s in $name. Is there some way I can escape $name or make it so that the /'s don't mess up.

 

Thanks,

n3m.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.