Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
How do I call localStorage to array values in php

I have tried to pass the values from javascript to PHP

Javascript

<script type="text/javascript">
    
const formData = JSON.parse(localStorage.getItem('formdata'));
const getthelocation = formData.getthelocation;`
</script>

PhP

<?php
$getLoc= ["<script>document.writeln(getthelocation );</script>"];
var_export ($getLoc);

Output

ARRAY ( 0 => 'ISTANBUL,TOKAT,BURSA,YALOVA ', )

But I'm Looking for

ARRAY ( 0 => 'ISTANBUL', 1 =>'TOKAT', 2 =>'BURSA', 3 =>'YALOVA')

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Send your data from local storage in JS script, after this you can make with your data all you need: explode it by comma, make some value object, etc.

This will be the correct way.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!