Navigation

    ask avan logo
    • Register
    • Login
    • Search
    • Categories
    • Unsolved
    • Solved
    1. Home
    2. Categories
    3. Coding Question & Answers
    4. PHP
    Log in to post
    • Newest to Oldest
    • Oldest to Newest
    • Most Posts
    • Most Votes

    PHP

    • MPG Radio

      UNSOLVED Save and edit in json database.
      • MPG Radio  

      3
      3
      Posts
      15
      Views

      MPG Radio

      I can send you the app...download no problem..
      Here is a download of the working example...

      Hope this helps....the values are different in each case and unique, they are created upon submission and added to the json array, then for editing, I wish to be able to correct anything that needs correcting.

    • MPG Radio

      SOLVED Switch statement php
      php • • MPG Radio  

      6
      6
      Posts
      70
      Views

      MPG Radio

      Adding the solution I had come up with.

      <?php // get the date in an easy to compare format: Jan 1st is 1 01, Dec 31st 12 31 $date = date('n') * 100 + date('j'); if($date < 104) { $content = "Sagittarius"; } elseif($date < 105) { //January $content = "Dahnus"; } elseif($date < 118) { //January $content = "Capricornus"; } elseif($date < 201) { //February $content = "Makra"; } elseif($date < 215) { //February $content = "Aquarius"; } elseif($date < 218) { //February $content = "Kumbha"; } elseif($date < 305) { $content = "Pisces"; } elseif($date < 801) { //August $content = "Leo"; } elseif($date < 831) { //september $content = "Simha"; } elseif($date < 918) { //september $content = "virgo"; } elseif($date < 1001) { //september $content = "virgo"; } elseif($date < 1016) { //october $content = "Kanya"; } elseif($date < 1017) { //october $content = "Libra"; } elseif($date < 1105) { //november $content = "Tula"; } elseif($date < 1124) { //november $content = "Scorpius"; } elseif($date < 1208) { $content = "Vrishika"; } elseif($date < 1228) { $content = "Sagittarius"; } else { $content = "Sagittarius"; } echo $content; ?>
    • MPG Radio

      SOLVED How would I add an exclusion to all files and folders except .mp3?
      • MPG Radio  

      5
      5
      Posts
      27
      Views

      MPG Radio

      Ok my bad was serving over https.....duh...thank you.

    • Miracle Seriki

      UNSOLVED Please I'm trying to spend woocommerce order to another website using api, this the code I'm using but it doesn't work pls help me
      • Miracle Seriki  

      2
      2
      Posts
      55
      Views

      avan

      Hey @Miracle-Seriki

      I tried to look into your problem but it's hard to figure out what exactly is wrong unless I can re-create the problem or at least see what error message you are receiving.

    • MPG Radio

      UNSOLVED Exclude Text from the out put using printf
      • MPG Radio  

      1
      1
      Posts
      67
      Views

      No one has replied

    • MPG Radio

      UNSOLVED Create m3u playlist from a folder and place in directory
      • MPG Radio  

      4
      4
      Posts
      84
      Views

      avan

      Sounds good @MPG-Radio Thanks!

    • Laurens van Oorschot

      UNSOLVED How do I get the selected ID of the second dropbox based on the first dropbox in PHP with a refresh?
      • Laurens van Oorschot  

      1
      1
      Posts
      6
      Views

      No one has replied

    • MPG Radio

      SOLVED Parsing m3u from single column to two equal columns
      • MPG Radio  

      5
      5
      Posts
      36
      Views

      MPG Radio

      got it going and works just fine with some minor adjustments to fit the application.
      demo

      function outputPlaylist($playlist) { $entries = parse_m3u($playlist); echo "<div class='row'>\n"; echo "<pre>\n"; $size = sizeof($entries); $size_half = ceil($size / 2); $counter = 0; echo "<div class='row'>\n"; echo "<div class='column'>\n"; foreach($entries as $entry) { // Check for half way point if($counter++ == $size_half ){ // Close column and open new one echo "</div>\n"; } printf ("%s\n", $entry['title'], $entry['artist'] ); } // Close column and row echo "</div>\n"; echo "</pre>"; echo "</div>\n"; } ?>
    • MPG Radio

      SOLVED Adding an extention .txt to a saved file from checkbox selections
      • MPG Radio  

      3
      3
      Posts
      36
      Views

      MPG Radio

      That's so weird it works with this change..

      $name = time(); $txtName = $name . ".txt"; $myFile=fopen($txtName,"a"); $txt = $VarCheck; fwrite($myFile,$txt); fclose($myFile);
    • MPG Radio

      UNSOLVED How to delete multible images in a directory with a checkbox.
      • MPG Radio  

      4
      4
      Posts
      37
      Views

      MPG Radio

      Pretty good but I haven't been able to get it working...:)

    • MPG Radio

      SOLVED How to copy files from one directory and adding two supporting files into the copied directory/directories
      • MPG Radio  

      5
      5
      Posts
      38
      Views

      MPG Radio

      Thank you, so now I know how to include more than one file and not just the files in a directory when moving a directory to another directory.

    • MPG Radio

      SOLVED How do I finish writing in a delete function into this code to delete both directory and files in it?
      • MPG Radio  

      9
      9
      Posts
      36
      Views

      MPG Radio

      It's perfect, I did make that small change to delete from the images folder. Without your input, I likely wouldn't have figured that out. This is the small change made.

      $curr_dir = './'.$dir . '/images';

      So with more work, I have styled things up to be like this.
      delete.jpg

      I will add that the purpose of all this was to manage the unneeded images that are placed in a directory via FTP from security cams. I hope I'm not rambling too much.

    • Leo Lesole

      UNSOLVED How To pair and rearrange string values from a variable in PHP ?
      javascript php • • Leo Lesole  

      2
      2
      Posts
      20
      Views

      avan

      Hey @Leo-Lesole

      To do string concatenation in PHP you can use a period (dot)
      Example:

      $DataToDB = "Parttype=".$partType."&LabelPart=".$labelPart."&PartBin=".$partbin;

      Not sure if that is what you had in mind. Let me know.

    • D

      UNSOLVED How to start flushing/printing out a curl request on to go.
      • DavidNG  

      1
      1
      Posts
      15
      Views

      No one has replied

    • Filippo Rezzadore

      UNSOLVED I am trying to update the value in a post custom field as automatically with a variable value.
      • Filippo Rezzadore  

      1
      1
      Posts
      10
      Views

      No one has replied

    • Clarity

      UNSOLVED CKEditor doesn't save content and adds extra <p></p> (Symfony4)
      • Clarity  

      1
      1
      Posts
      26
      Views

      No one has replied

    • J

      UNSOLVED PHP for loop over array acting weird..
      array for loop php • • jimmi  

      2
      2
      Posts
      21
      Views

      avan

      @jimmi

      What is $sectionamount ? Is that the same as $hoevelsections ?

      What is the purpose of it? Are you trying to print all items in the last array you listed:

      Array ( [0] => Entrance [1] => Door & Door frame [2] => Kombuis [3] => vloer [4] => kaste [5] => Kamer [6] => gang [7] => bed [8] => mat )