I have a problem.
index.php
ob_start(); include '../view/user.php'; $include = ob_get_clean(); echo json_encode(array( "success" => true, "status" => "ok", "data" => $include));
user.php
<div> <h2 class='workspace-name'> <?php echo $name; ?> </h2> </div>
The problem is that if I correctly enter the html element in user.php (for readability), there will be a lot of \ r \ n \ t \ t \ t. if i use jquery.get to get json dataType. How to get rid of / r / t / n? Although it does not appear on the screen, but I do not feel good. Is there a better solution? Any question, please write in the comments, I will edit this. thanks
source share