Click here to Skip to main content
15,507,755 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Master Detail CRUD using blazor Pin
Mycroft Holmes15-Apr-21 14:52
professionalMycroft Holmes15-Apr-21 14:52 
QuestionDo events like slider and drag and drop need to be well known? Pin
Oyee 202129-Mar-21 20:31
Oyee 202129-Mar-21 20:31 
AnswerModeration Pin
Nelek29-Mar-21 20:32
protectorNelek29-Mar-21 20:32 
AnswerRe: Do events like slider and drag and drop need to be well known? Pin
Richard Deeming29-Mar-21 22:42
mveRichard Deeming29-Mar-21 22:42 
QuestionHTML Rotate results in messed up and unresponsive design. Pin
Resource Link26-Mar-21 8:19
Resource Link26-Mar-21 8:19 
QuestionRefresh token API development and documentation Pin
kyclk1125-Mar-21 20:15
kyclk1125-Mar-21 20:15 
QuestionPHP7, how to create a json array of keyvalues from an object Pin
jkirkerx25-Mar-21 11:57
professionaljkirkerx25-Mar-21 11:57 
AnswerRe: PHP7, how to create a json array of keyvalues from an object Pin
jkirkerx26-Mar-21 12:18
professionaljkirkerx26-Mar-21 12:18 
I can't believe how much time I spent on this, to write about 5 lines of code. I wasn't able to get my object forJson() to work 100% but I'm pretty close on it, actually being able to generate JSON from an object->forJson();. So this is my temp solution for now so I can move forward.

I'm kind of surprised that json_encode knew to wrap the strings in quotes, and leave the numbers as is.
$jsonArray = [];
foreach ($keyValues as $keyValue) {

    $jsonItem = array(
        "key" => $keyValue->getKey(),
        "value" => $keyValue->getValue()
    );
    array_push($jsonArray, $jsonItem);

}

echo json_encode($jsonArray, JSON_PRETTY_PRINT);
Also using plain Javascript, and trying to stay sort of ECMA 6, which also took forever to figure out yet so simple. This is inside a Fetch call to a PHP file that just echos out JSON.

I was really surprised that I didn't have to parse the JSON, or do anything special with it. I fiddled with the Object using different types and they all seem to produce the same values.
for (const keyValue of Object.values(data)) {

    let option = document.createElement('option');
    option.text = keyValue.key;
    option.value = keyValue.value;
    addOperationElement.add(option);

}

Alright, back to being able to move forward with this section of the app. I'm starting to like PHP V7+ and can see why so many companies use it. It does the job and is fairly simple to construct and fabricate. But you need a damn good editor like PHP Storm to keep it organized and clean.
If it ain't broke don't fix it
Discover my world at jkirkerx.com

QuestionHi, can someone help me with file-upload feature for my Angular app? Pin
kyclk1117-Mar-21 4:41
kyclk1117-Mar-21 4:41 
AnswerRe: Hi, can someone help me with file-upload feature for my Angular app? Pin
jkirkerx25-Mar-21 12:02
professionaljkirkerx25-Mar-21 12:02 
QuestionReduce Javascript Pin
Member 1497619910-Mar-21 15:12
Member 1497619910-Mar-21 15:12 
AnswerRe: Reduce Javascript Pin
Richard Deeming10-Mar-21 22:34
mveRichard Deeming10-Mar-21 22:34 
GeneralRe: Reduce Javascript Pin
Member 1497619910-Mar-21 22:41
Member 1497619910-Mar-21 22:41 
GeneralRe: Reduce Javascript Pin
Richard Deeming10-Mar-21 22:46
mveRichard Deeming10-Mar-21 22:46 
GeneralRe: Reduce Javascript Pin
Member 1497619910-Mar-21 23:04
Member 1497619910-Mar-21 23:04 
GeneralRe: Reduce Javascript Pin
Richard Deeming10-Mar-21 23:18
mveRichard Deeming10-Mar-21 23:18 
GeneralRe: Reduce Javascript Pin
Member 1497619911-Mar-21 0:01
Member 1497619911-Mar-21 0:01 
QuestionHI can someone help me with my responsive gallery project? Pin
Florina Catalina10-Mar-21 5:38
Florina Catalina10-Mar-21 5:38 
AnswerRe: HI can someone help me with my responsive gallery project? Pin
Richard MacCutchan10-Mar-21 23:23
mveRichard MacCutchan10-Mar-21 23:23 
GeneralRe: HI can someone help me with my responsive gallery project? Pin
Florina Catalina12-Mar-21 7:24
Florina Catalina12-Mar-21 7:24 
GeneralRe: HI can someone help me with my responsive gallery project? Pin
Richard MacCutchan12-Mar-21 7:42
mveRichard MacCutchan12-Mar-21 7:42 
AnswerRe: HI can someone help me with my responsive gallery project? Pin
NotTodayYo12-Mar-21 8:15
NotTodayYo12-Mar-21 8:15 
AnswerRe: HI can someone help me with my responsive gallery project? Pin
Member 1529865622-Jul-21 22:56
Member 1529865622-Jul-21 22:56 
QuestionHello, i need some help for a project with css and html Pin
Florina Catalina10-Mar-21 5:38
Florina Catalina10-Mar-21 5:38 
QuestionHelp me remove unused CSS Pin
maithu7029-Mar-21 2:27
maithu7029-Mar-21 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.