Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. D

    PHP How to remove part of a pattern with regular expression

    Brilliant! Thank you much appreciated
  2. D

    PHP How to remove part of a pattern with regular expression

    I $string = '"name","first name,","mothers name","maiden name,"'; $newstring = preg_replace('/\w\,\"/','"',$string); How to remove the stray commas (in bold) from inside the quotation marks and leave the delimiters? The above code also removes the last character $newstring = "name","first...
  3. D

    JavaScript Help with JSON

    Absolutely brilliant thank you so much. All working 100%. I couldn't find the 'Promises.all' to ditch so I placed the code above the loop and all seem to work okay upstreamLevels.forEach(stationRef => { outputElement.append('<div class="station-' +...
  4. D

    JavaScript Help with JSON

    Thank you again that's moved it on to 99% of what's required. The remaining issue is the data for each level station now displays in random order in <div id="measures">...loading</div> and needs to be listed in the order of the 'upstreamLevels [ ]' (station references) array. var...
  5. D

    JavaScript Help with JSON

    "Why you need the variables to be global?" Thank you again your help is much appreciated. I think I may have gone about this all the wrong way. The variable currentReading is created by a top level json loop. The maxOnRecord & topOfNormalRange data is contained in another json file which I...
  6. D

    JavaScript Help with JSON

    Thank you very much for the above which moves me forward but not to the place I need to be. I really want to use the captured variables globally. The function loops through all station references and correctly shows the result for each in the alert, but is it possible to use the variables...
  7. D

    JavaScript Help with JSON

    Hi please can anyone help I'm struggling to understand JSON. I need to return two variables from a json function for use with measuring water levels but the returned variables are undefined. $levelMarkers = getStationData(stationReference); rangeTop = $levelMarkers[0]; recordLevel =...
Back
Top Bottom