• Replace punctuation in an associative array

    From The Doctor@21:1/5 to All on Thu Mar 2 12:44:41 2023
    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    How can I do this?

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Only an evil person could punish someone for doing good, and only an evil ideology could allow it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to which you have on Thu Mar 2 14:23:37 2023
    On 3/2/23 13:44, The Doctor wrote:

    A wild guess, this still to do with your json, which you have asked help
    with quite often.

    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    Don't store objects as an array and place those arrays in an array.

    Create an object and place the object into the array which is part of
    your main-object.


    How can I do this?

    If you just look at a string, string replace could work quite well to do
    this
    str_replace('[[','[',$str);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Fri Mar 3 01:03:01 2023
    J.O. Aho <user@example.net> wrote:
    : On 3/2/23 13:44, The Doctor wrote:

    : A wild guess, this still to do with your json, which you have asked help
    : with quite often.

    : > I wish to replace [[ with [
    : >
    : > AND
    : >
    : > ]] with ] in an associative array .

    : Don't store objects as an array and place those arrays in an array.

    : Create an object and place the object into the array which is part of
    : your main-object.

    All right. Even in a recursive loop?


    : > How can I do this?

    : If you just look at a string, string replace could work quite well to do
    : this
    : str_replace('[[','[',$str);


    Woth a try.


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b The kingdom is inside out. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Fri Mar 3 08:14:22 2023
    The Doctor, 2023-03-02 13:44:

    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    How can I do this?

    What do you mean with "in an associative array"? The values? The keys?

    If you want to replace the characters in values:

    <?php
    $array = [
    'value 1' => '[[something 1',
    'value 2' => 'something 2]]',
    ];

    // Output array as it was before
    print_r($array);

    foreach($array as $key => $value)
    {
    $array[$key] = str_replace(
    [ '[[', ']]' ],
    [ '[', ']' ],
    $value
    );
    }

    // Output as it was afterwards
    print_r($array);



    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Fri Mar 3 10:36:06 2023
    On 3/3/23 02:03, The Doctor wrote:
    J.O. Aho <user@example.net> wrote:
    : On 3/2/23 13:44, The Doctor wrote:

    : A wild guess, this still to do with your json, which you have asked help
    : with quite often.

    : > I wish to replace [[ with [
    : >
    : > AND
    : >
    : > ]] with ] in an associative array .

    : Don't store objects as an array and place those arrays in an array.

    : Create an object and place the object into the array which is part of
    : your main-object.

    All right. Even in a recursive loop?

    A recursive function should just return an array, but this array needs
    to be assigned to the objects array variable, not as a cell in that array.

    _not_ like:
    $object->array[] = recursiveLoopFunction($inputdate);

    but like:
    $object->array = recursiveLoopFunction($inputdate);


    : > How can I do this?

    : If you just look at a string, string replace could work quite well to do
    : this
    : str_replace('[[','[',$str);

    Woth a try.

    I wouldn't say it's worth trying, it's tends to be better to do things
    the right way from the beginning. I do recommend you make classes that represents how your json should look like for example if you have:

    {
    "order_id" : 12334,
    "total_tax": 1.10,
    "total_value": 100,
    "cart": [
    {
    "name": "item1",
    "quantity": 1,
    "price": 10
    },
    {
    "name": "item2",
    "quantity": 2,
    "price": 45
    },
    ]
    }

    This would be two classes, the item class and the order class

    class item {
    public string $name;
    public int $quantity;
    public float $price;
    }

    class order {
    public int $order_id;
    public float $total_tax;
    public float $total_value;
    public $cart = array();
    }

    here is an example code

    <?php
    // this is the input data we assume this is your POST data
    $inputData = array("order_id" => 1234, "cart" => array( array("name" => "item1", "quantity" => 1, "price" => 10), array("name" => "item2",
    "quantity" => 2, "price" => 45) ) );

    // this is the classes we have that describes the json
    // we do init some values, just in case.
    class item {
    public string $name;
    public int $quantity = 0;
    public float $price = 0.0;
    }

    class order {
    public int $order_id;
    public float $total_tax = 0.0;
    public float $total_value = 0.0;
    public $cart = array();
    }


    // here we assign the values from the post data
    // without really verifying the data is okay
    $order = new order();
    $order->order_id = $inputData["order_id"];
    $tax = 0.011; // an assumed tax % for this simplified example

    // now we process the cart items
    // we should take the price from a database
    // instead of trusting a user
    foreach($inputData["cart"] as $itemData) {
    $item = new item();
    $item->name = $itemData["name"];
    $item->quantity = $itemData["quantity"];
    $item->price = $itemData["price"];
    // we add the item to the cart array in the order object
    $order->cart[] = $item;
    // we store the totla_value in a local variable as we need it for the tax
    $total_value = $item->quantity * $item->price;
    // update the order total value/tax
    $order->total_value += $total_value;
    $order->total_tax += $tax * $total_value;
    }

    // the json should be the same as the one above the code, a zero missing,
    // but should cause any issues as the value is equal.
    echo json_encode($order, JSON_PRETTY_PRINT);
    echo "\n"; // just a new line so that the prompt will come back below
    the json


    Don't forget that you can make functions that do parts of the moving
    data from the post data to the different objects, this way you make it
    easier to see what the code does and should make it easier to locate
    where a fault is without being distracted by code not related.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Arno Welzel on Sat Mar 4 05:19:54 2023
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-02 13:44:

    : > I wish to replace [[ with [
    : >
    : > AND
    : >
    : > ]] with ] in an associative array .
    : >
    : > How can I do this?

    : What do you mean with "in an associative array"? The values? The keys?

    : If you want to replace the characters in values:

    : <?php
    : $array = [
    : 'value 1' => '[[something 1',
    : 'value 2' => 'something 2]]',
    : ];

    : // Output array as it was before
    : print_r($array);

    : foreach($array as $key => $value)
    : {
    : $array[$key] = str_replace(
    : [ '[[', ']]' ],
    : [ '[', ']' ],
    : $value
    : );
    : }

    : // Output as it was afterwards
    : print_r($array);

    What is happening is that the arrauy is being formed by a subarray
    and the end product is seeing a [[ at the start and a ]]
    at the end when it should be seeing a [ at the start and a ] at the end.



    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Sat Mar 4 11:07:35 2023
    On 3/4/23 06:19, The Doctor wrote:
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-02 13:44:

    : > I wish to replace [[ with [
    : >
    : > AND
    : >
    : > ]] with ] in an associative array .
    : >
    : > How can I do this?

    : What do you mean with "in an associative array"? The values? The keys?

    : If you want to replace the characters in values:

    : <?php
    : $array = [
    : 'value 1' => '[[something 1',
    : 'value 2' => 'something 2]]',
    : ];

    : // Output array as it was before
    : print_r($array);

    : foreach($array as $key => $value)
    : {
    : $array[$key] = str_replace(
    : [ '[[', ']]' ],
    : [ '[', ']' ],
    : $value
    : );
    : }

    : // Output as it was afterwards
    : print_r($array);

    What is happening is that the arrauy is being formed by a subarray
    and the end product is seeing a [[ at the start and a ]]
    at the end when it should be seeing a [ at the start and a ] at the end.



    You place your object in too many arrays, it had been better doing it
    the "right way" from the beginning,

    It's not that hard to create the json you want when using classes, in
    like 20mins I managed to generate this json from my objects:

    {
    "store_id": null,
    "api_token": null,
    "checkout_id": null,
    "txn_total": null,
    "environment": null,
    "action": null,
    "token": [
    {
    "data_key": "1234",
    "issuer_id": "645sddfvdrt4tefd"
    },
    {
    "data_key": "5678",
    "issuer_id": "645sddfvdrt4tefd"
    }
    ],
    "ask_cvv": null,
    "order_no": null,
    "cust_id": null,
    "dynamic_descriptor": null,
    "language": null,
    "recur": {
    "bill_now": null,
    "recur_amount": null,
    "start_date": null,
    "recur_unit": null,
    "recur_period": null,
    "number_of_recurs": null
    },
    "cart": {
    "items": [
    {
    "url": "https:\/\/example.net\/item?id=1",
    "description": "item 1",
    "product_code": "1",
    "unit_cost": "100",
    "quantity": "1"
    },
    {
    "url": "https:\/\/example.net\/item?id=2",
    "description": "item 2",
    "product_code": "2",
    "unit_cost": "200",
    "quantity": "1"
    }
    ],
    "subtotal": null,
    "tax": {
    "amount": null,
    "description": null,
    "rate": null
    }
    },
    "contact_details": {
    "first_name": null,
    "last_name": null,
    "email": null,
    "phone": null
    },
    "shipping_details": {
    "address_1": null,
    "address_2": null,
    "city": null,
    "province": null,
    "country": null,
    "postal_code": null
    },
    "billing_details": {
    "address_1": null,
    "address_2": null,
    "city": null,
    "province": null,
    "country": null,
    "postal_code": null
    }
    }

    I assumed that all values has to always be there, like an empty token
    list would be [] instead of null and so on, add two tokens and two items.
    using __construct(...) you could make it possible to input the values at
    once instead of how I done creating the object and then assign each
    variable one by one. You have the opportunity to improve things.

    https://pastebin.com/jnz1RYWj

    sadly Moneris seems to want everything to be as strings, if you could
    have used float/decimal/duble/int then you didn't have to convert
    between string and a numeric value back and forth.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Sat Mar 4 14:42:44 2023
    The Doctor, 2023-03-04 06:19:

    [...]
    What is happening is that the arrauy is being formed by a subarray
    and the end product is seeing a [[ at the start and a ]]
    at the end when it should be seeing a [ at the start and a ] at the end.

    Then don't create a subarray!

    Again: if you need objects, then create objects and not arrays!


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Arno Welzel on Sat Mar 4 14:57:04 2023
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-04 06:19:

    : [...]
    : > What is happening is that the arrauy is being formed by a subarray
    : > and the end product is seeing a [[ at the start and a ]]
    : > at the end when it should be seeing a [ at the start and a ] at the end.

    : Then don't create a subarray!

    : Again: if you need objects, then create objects and not arrays!


    J.A AHo and Arno ,

    2 Problems here

    a) Converting a page from a programmer that did not use classes

    b) Web pages that actually you can search adn
    the results give you not what you want.

    If you 2 had quality web pages on PHP
    programming , you should be up there and not the pages
    Google, yahoo et al as showing.

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Sat Mar 4 16:38:20 2023
    On 3/4/23 15:57, The Doctor wrote:
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-04 06:19:

    : [...]
    : > What is happening is that the arrauy is being formed by a subarray
    : > and the end product is seeing a [[ at the start and a ]]
    : > at the end when it should be seeing a [ at the start and a ] at the end.

    : Then don't create a subarray!

    : Again: if you need objects, then create objects and not arrays!


    J.A AHo and Arno ,

    2 Problems here

    a) Converting a page from a programmer that did not use classes

    Then you need to rewrite things, how many weeks hasn't you spent on
    trying to get a proper json of the mess of arrays. Doing it right and
    rewrite, I think you would have finished a month ago already.

    Take a look at the following code, test it too and you see the benefit https://pastebin.com/yJC9DJWs

    If you rewrite things now, you will save time and efforts in the future, specially if there comes changes to the API.


    b) Web pages that actually you can search adn
    the results give you not what you want.

    If you 2 had quality web pages on PHP
    programming , you should be up there and not the pages
    Google, yahoo et al as showing.

    php.net is IMHO a really good source for information.

    Sometimes Packt hands out free PHP books, just keep on looking at https://www.packtpub.com/free-learning
    one book a day and after a while you will see the same book again...

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to J.O. Aho on Sun Mar 5 00:41:30 2023
    On 3/4/23 16:38, J.O. Aho wrote:
    On 3/4/23 15:57, The Doctor wrote:

    a) Converting a page from a programmer that did not use classes

    Then you need to rewrite things, how many weeks hasn't you spent on
    trying to get a proper json of the mess of arrays. Doing it right and rewrite, I think you would have finished a month ago already.

    Take a look at the following code, test it too and you see the benefit https://pastebin.com/yJC9DJWs

    If you rewrite things now, you will save time and efforts in the future, specially if there comes changes to the API.

    Looking at your old posts, using the above code you would endup with
    something like this (not tested):

    https://pastebin.com/bF6bZseu

    this has same issues with unvalidated data, but at least now no one will
    get the items for free as the transaction value is calculated while
    adding items to the carts items array.

    if it's mainly changing how to load values from post, it's a short times convertion, if you store vallues in the session, then you need slightly
    more changes, specially if you need to access values, but should be quit
    simple to find out where with help of php lint function (php -l sourcodefile.php).


    Keep in mind nothin is a 100% solution for your issue as I haven't
    bothered really go into the API that is used but just a bit based on
    your posts in this group.

    And please, what ever you do, don't go with the str_replace, it's not
    the solution to your issue, it will just make things a lot harder to
    maintain.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Sat Mar 4 23:58:35 2023
    J.O. Aho <user@example.net> wrote:
    : On 3/4/23 16:38, J.O. Aho wrote:
    : > On 3/4/23 15:57, The Doctor wrote:

    : >> a) Converting a page from a programmer that did not use classes
    : >
    : > Then you need to rewrite things, how many weeks hasn't you spent on
    : > trying to get a proper json of the mess of arrays. Doing it right and
    : > rewrite, I think you would have finished a month ago already.
    : >
    : > Take a look at the following code, test it too and you see the benefit
    : > https://pastebin.com/yJC9DJWs
    : >
    : > If you rewrite things now, you will save time and efforts in the future,
    : > specially if there comes changes to the API.

    : Looking at your old posts, using the above code you would endup with
    : something like this (not tested):

    : https://pastebin.com/bF6bZseu

    : this has same issues with unvalidated data, but at least now no one will
    : get the items for free as the transaction value is calculated while
    : adding items to the carts items array.

    : if it's mainly changing how to load values from post, it's a short times
    : convertion, if you store vallues in the session, then you need slightly
    : more changes, specially if you need to access values, but should be quit
    : simple to find out where with help of php lint function (php -l
    : sourcodefile.php).


    : Keep in mind nothin is a 100% solution for your issue as I haven't
    : bothered really go into the API that is used but just a bit based on
    : your posts in this group.

    : And please, what ever you do, don't go with the str_replace, it's not
    : the solution to your issue, it will just make things a lot harder to
    : maintain.


    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Sun Mar 5 00:52:23 2023
    In article <k6i6l8FksscU2@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 3/5/23 00:58, The Doctor wrote:
    J.O. Aho <user@example.net> wrote:

    : https://pastebin.com/bF6bZseu
    : Keep in mind nothin is a 100% solution for your issue as I haven't
    : bothered really go into the API that is used but just a bit based on
    : your posts in this group.

    : And please, what ever you do, don't go with the str_replace, it's not
    : the solution to your issue, it will just make things a lot harder to
    : maintain.


    Actually the class approach works better.

    That's good, just tweak it to fit your user case, just don't forget
    validate the input data.


    Too bad Google does not pick that up
    in their searches for JSON>

    Much depends on the requirements and what the json is used for, say
    sending data between angular and php, then the coder is usually in
    control of both front end and backend and can use what ever json format
    they want, but it's different when you have to follow an API, but
    usually you can get support from the API owner and payment services tend
    to also do a verification round before letting you to use production
    grade transactions.


    A good article can be written about this.

    --
    //Aho



    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Sun Mar 5 01:39:04 2023
    On 3/5/23 00:58, The Doctor wrote:
    J.O. Aho <user@example.net> wrote:

    : https://pastebin.com/bF6bZseu
    : Keep in mind nothin is a 100% solution for your issue as I haven't
    : bothered really go into the API that is used but just a bit based on
    : your posts in this group.

    : And please, what ever you do, don't go with the str_replace, it's not
    : the solution to your issue, it will just make things a lot harder to
    : maintain.


    Actually the class approach works better.

    That's good, just tweak it to fit your user case, just don't forget
    validate the input data.


    Too bad Google does not pick that up
    in their searches for JSON>

    Much depends on the requirements and what the json is used for, say
    sending data between angular and php, then the coder is usually in
    control of both front end and backend and can use what ever json format
    they want, but it's different when you have to follow an API, but
    usually you can get support from the API owner and payment services tend
    to also do a verification round before letting you to use production
    grade transactions.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Sun Mar 5 12:16:43 2023
    On 3/5/23 01:52, The Doctor wrote:
    In article <k6i6l8FksscU2@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 3/5/23 00:58, The Doctor wrote:
    J.O. Aho <user@example.net> wrote:

    : https://pastebin.com/bF6bZseu
    : Keep in mind nothin is a 100% solution for your issue as I haven't
    : bothered really go into the API that is used but just a bit based on
    : your posts in this group.

    : And please, what ever you do, don't go with the str_replace, it's not
    : the solution to your issue, it will just make things a lot harder to
    : maintain.


    Actually the class approach works better.

    That's good, just tweak it to fit your user case, just don't forget
    validate the input data.


    Too bad Google does not pick that up
    in their searches for JSON>

    Much depends on the requirements and what the json is used for, say
    sending data between angular and php, then the coder is usually in
    control of both front end and backend and can use what ever json format
    they want, but it's different when you have to follow an API, but
    usually you can get support from the API owner and payment services tend
    to also do a verification round before letting you to use production
    grade transactions.


    A good article can be written about this.

    Great, post the link when you have written it ;)

    It's about time, to write a good example that make sense without bad
    coding and then host and promote the page, not everyone is prepared to
    do that.

    Sadly we see a lot of cheap cut the corner stuff out on the net, much
    for people have sample with simple structures so arrays works ok, but
    that is much based on the quality of the education they had. For example
    there is a country that spits out 2 million CS each year, many of them
    have a skills level not much than general high school students
    programing knowledge level. Should also note that there are really good programmers from that country too.

    The main thing is that you get forward on your project.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Sun Mar 5 14:08:31 2023
    J.O. Aho <user@example.net> wrote:
    : On 3/5/23 01:52, The Doctor wrote:
    : > In article <k6i6l8FksscU2@mid.individual.net>,
    : > J.O. Aho <user@example.net> wrote:
    : >> On 3/5/23 00:58, The Doctor wrote:
    : >>> J.O. Aho <user@example.net> wrote:
    : >>
    : >>> : https://pastebin.com/bF6bZseu
    : >>> : Keep in mind nothin is a 100% solution for your issue as I haven't
    : >>> : bothered really go into the API that is used but just a bit based on
    : >>> : your posts in this group.
    : >>>
    : >>> : And please, what ever you do, don't go with the str_replace, it's not
    : >>> : the solution to your issue, it will just make things a lot harder to
    : >>> : maintain.
    : >>>
    : >>>
    : >>> Actually the class approach works better.
    : >>
    : >> That's good, just tweak it to fit your user case, just don't forget
    : >> validate the input data.
    : >>
    : >>
    : >>> Too bad Google does not pick that up
    : >>> in their searches for JSON>
    : >>
    : >> Much depends on the requirements and what the json is used for, say
    : >> sending data between angular and php, then the coder is usually in
    : >> control of both front end and backend and can use what ever json format
    : >> they want, but it's different when you have to follow an API, but
    : >> usually you can get support from the API owner and payment services tend
    : >> to also do a verification round before letting you to use production
    : >> grade transactions.
    : >>
    : >
    : > A good article can be written about this.

    : Great, post the link when you have written it ;)

    : It's about time, to write a good example that make sense without bad
    : coding and then host and promote the page, not everyone is prepared to
    : do that.

    : Sadly we see a lot of cheap cut the corner stuff out on the net, much
    : for people have sample with simple structures so arrays works ok, but
    : that is much based on the quality of the education they had. For example
    : there is a country that spits out 2 million CS each year, many of them
    : have a skills level not much than general high school students
    : programing knowledge level. Should also note that there are really good
    : programmers from that country too.

    : The main thing is that you get forward on your project.


    Wait until you see the nightmare in bureaucracy.

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ezimene nimi Teine nimi@21:1/5 to The Doctor on Mon Mar 6 03:23:39 2023
    Get to: http://aaaaaaaaaaaaaaaar.medianewsonline.com/firstpage.php

    And invite all Your friends too !!!!!!!!!!!




    On Thursday, March 2, 2023 at 2:47:42 PM UTC+2, The Doctor wrote:
    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    How can I do this?

    --
    Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b
    Only an evil person could punish someone for doing good, and only an evil ideology could allow it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Ezimene nimi Teine nimi on Mon Mar 6 16:21:55 2023
    Ezimene nimi Teine nimi <yyyyyeeeee00000@writeme.com> wrote:
    : Get to: http://aaaaaaaaaaaaaaaar.medianewsonline.com/firstpage.php

    : And invite all Your friends too !!!!!!!!!!!




    : On Thursday, March 2, 2023 at 2:47:42=E2=80=AFPM UTC+2, The Doctor wrote:
    : > I wish to replace [[ with [=20
    : >=20
    : > AND=20
    : >=20
    : > ]] with ] in an associative array .=20
    : >=20
    : > How can I do this?=20
    : >=20
    : > --=20
    : > Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca=20
    : > Yahweh, King & country!Never Satan President Republic!Beware AntiChrist r= : ising!=20
    : > Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=3D94= : a1f39b=20
    : > Only an evil person could punish someone for doing good, and only an evil= : ideology could allow it. -unknown Beware https://mindspring.com

    This abusive spamtroll came from

    X-Received: by 2002:a05:620a:16a8:b0:734:134b:5482 with SMTP id s8-20020a05620a 16a800b00734134b5482mr2183538qkj.1.1678101819692;
    Mon, 06 Mar 2023 03:23:39 -0800 (PST)
    X-Received: by 2002:a81:ac4c:0:b0:533:9ffb:cb11 with SMTP id
    z12-20020a81ac4c000000b005339ffbcb11mr6645292ywj.7.1678101819283; Mon, 06 Mar
    2023 03:23:39 -0800 (PST)
    Path: news.nk.ca!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.c
    om!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!new
    s.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!g
    oogle-groups.googlegroups.com!not-for-mail
    Newsgroups: comp.lang.php
    Date: Mon, 6 Mar 2023 03:23:39 -0800 (PST)
    In-Reply-To: <ttq5np$i9r$50@gallifrey.nk.ca>
    Injection-Info: google-groups.googlegroups.com; posting-host=82.131.38.37; post
    ing-account=HfIszAoAAAC8ch6q3uChpTWUALHCfEoF
    NNTP-Posting-Host: 82.131.38.37
    References: <ttq5np$i9r$50@gallifrey.nk.ca>
    User-Agent: G2/1.0
    MIME-Version: 1.0
    Message-ID: <a8202a35-226d-4598-952d-3fe95e2446e8n@googlegroups.com>
    Subject: Re: Replace punctuation in an associative array
    From: Ezimene nimi Teine nimi <yyyyyeeeee00000@writeme.com>
    Injection-Date: Mon, 06 Mar 2023 11:23:39 +0000
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable
    X-Received-Bytes: 1883
    Xref: news.nk.ca comp.lang.php:167963


    Spamtrollers are trolls posting useless spam thinking it is content
    but are posting useless noise. Spamtrolls are newsgroup vandals!
    Thoses trolls are as bad as Donald
    Trump on Twitter.

    This makes https://groups.google.com/search/conversations?q=Depeer%20Google%20Groups

    Depeer Google groups Now!!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b We cannot defy gravity without paying a price. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to The Doctor on Tue Mar 7 16:43:02 2023
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    : J.O. Aho <user@example.net> wrote:
    : : On 3/5/23 01:52, The Doctor wrote:
    : : > In article <k6i6l8FksscU2@mid.individual.net>,
    : : > J.O. Aho <user@example.net> wrote:
    : : >> On 3/5/23 00:58, The Doctor wrote:
    : : >>> J.O. Aho <user@example.net> wrote:
    : : >>
    : : >>> : https://pastebin.com/bF6bZseu
    : : >>> : Keep in mind nothin is a 100% solution for your issue as I haven't
    : : >>> : bothered really go into the API that is used but just a bit based on : : >>> : your posts in this group.
    : : >>>
    : : >>> : And please, what ever you do, don't go with the str_replace, it's not : : >>> : the solution to your issue, it will just make things a lot harder to : : >>> : maintain.
    : : >>>
    : : >>>
    : : >>> Actually the class approach works better.
    : : >>
    : : >> That's good, just tweak it to fit your user case, just don't forget
    : : >> validate the input data.
    : : >>
    : : >>
    : : >>> Too bad Google does not pick that up
    : : >>> in their searches for JSON>
    : : >>
    : : >> Much depends on the requirements and what the json is used for, say
    : : >> sending data between angular and php, then the coder is usually in
    : : >> control of both front end and backend and can use what ever json format : : >> they want, but it's different when you have to follow an API, but
    : : >> usually you can get support from the API owner and payment services tend : : >> to also do a verification round before letting you to use production
    : : >> grade transactions.
    : : >>
    : : >
    : : > A good article can be written about this.

    : : Great, post the link when you have written it ;)

    : : It's about time, to write a good example that make sense without bad
    : : coding and then host and promote the page, not everyone is prepared to
    : : do that.

    : : Sadly we see a lot of cheap cut the corner stuff out on the net, much
    : : for people have sample with simple structures so arrays works ok, but
    : : that is much based on the quality of the education they had. For example
    : : there is a country that spits out 2 million CS each year, many of them
    : : have a skills level not much than general high school students
    : : programing knowledge level. Should also note that there are really good
    : : programmers from that country too.

    : : The main thing is that you get forward on your project.


    : Wait until you see the nightmare in bureaucracy.

    Other nightmare, I might have to write a preview page.


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Fools presume to know all; the wise know they do not. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Tue Mar 7 18:56:13 2023
    On 3/7/23 17:43, The Doctor wrote:
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    : J.O. Aho <user@example.net> wrote:
    : : On 3/5/23 01:52, The Doctor wrote:
    : : > In article <k6i6l8FksscU2@mid.individual.net>,
    : : > J.O. Aho <user@example.net> wrote:
    : : >> On 3/5/23 00:58, The Doctor wrote:
    : : >>> J.O. Aho <user@example.net> wrote:
    : : >>
    : : >>> : https://pastebin.com/bF6bZseu
    : : >>> : Keep in mind nothin is a 100% solution for your issue as I haven't : : >>> : bothered really go into the API that is used but just a bit based on
    : : >>> : your posts in this group.
    : : >>>
    : : >>> : And please, what ever you do, don't go with the str_replace, it's not
    : : >>> : the solution to your issue, it will just make things a lot harder to
    : : >>> : maintain.
    : : >>>
    : : >>>
    : : >>> Actually the class approach works better.
    : : >>
    : : >> That's good, just tweak it to fit your user case, just don't forget
    : : >> validate the input data.
    : : >>
    : : >>
    : : >>> Too bad Google does not pick that up
    : : >>> in their searches for JSON>
    : : >>
    : : >> Much depends on the requirements and what the json is used for, say
    : : >> sending data between angular and php, then the coder is usually in
    : : >> control of both front end and backend and can use what ever json format
    : : >> they want, but it's different when you have to follow an API, but
    : : >> usually you can get support from the API owner and payment services tend
    : : >> to also do a verification round before letting you to use production
    : : >> grade transactions.
    : : >>
    : : >
    : : > A good article can be written about this.

    : : Great, post the link when you have written it ;)

    : : It's about time, to write a good example that make sense without bad
    : : coding and then host and promote the page, not everyone is prepared to
    : : do that.

    : : Sadly we see a lot of cheap cut the corner stuff out on the net, much
    : : for people have sample with simple structures so arrays works ok, but
    : : that is much based on the quality of the education they had. For example : : there is a country that spits out 2 million CS each year, many of them
    : : have a skills level not much than general high school students
    : : programing knowledge level. Should also note that there are really good
    : : programmers from that country too.

    : : The main thing is that you get forward on your project.


    : Wait until you see the nightmare in bureaucracy.

    Other nightmare, I might have to write a preview page.

    I would make a function that can update an existing item in the orders
    cart, similar to the one AddItem, with the tweak that if the quantity is
    0 then it removes the item. Lets call the function for UpdateItem.

    In the overview page you do as before, create the order object,
    serialize it and store in the session.

    On the overview page you have to have some ajax calls, so that you can
    increase and decrease the quantity of items and of course delete. In the
    ajax call you need to send the project_code and also the new quantity.

    The php script will unserailize the order from session, do the
    changes, serialize the order and store it in session before sending
    response with the new order->txn_total, order->cart->subtotal, and order->cart->tax->amount

    You will then use javascript on the overview page to remove items and
    also update the values.

    When the customer want to proceed, you just go to the next page and you unserialize the order and use it as you did before to send it to the
    payment service.

    With help of Ajax, you can make things quite neat and maybe even avoid
    many unnecessary load of "full php pages". Use some framework if
    possible, I would give you just one advice, avoid angular, as you need
    to keep on updating it quite frequently.

    - - - - -

    if we have the order object we had in the examples earlier in the thread
    then you just serialize it with: $serialized_order = serialize($order);
    and the string would look like:

    O:5:"order":20:{s:16:"order_tax_rate";d:0.13;s:16:"order_subtotal";d:400;s:16:"order_taxtotal";d:52;s:8:"store_id";N;s:9:"api_token";N;s:11:"checkout_id";N;s:9:"txn_total";s:6:"452.00";s:11:"environment";N;s:6:"action";N;s:5:"token";a:2:{i:0;O:5:"token":
    2:{s:8:"data_key";s:4:"1234";s:9:"issuer_id";s:16:"645sddfvdrt4tefd";}i:1;O:5:"token":2:{s:8:"data_key";s:4:"5678";s:9:"issuer_id";s:16:"645sddfvdrt4tefd";}}s:7:"ask_cvv";N;s:8:"order_no";N;s:7:"cust_id";N;s:18:"dynamic_descriptor";N;s:8:"language";N;s:5:
    "recur";O:5:"recur":6:{s:8:"bill_now";N;s:12:"recur_amount";N;s:10:"start_date";N;s:10:"recur_unit";N;s:12:"recur_period";N;s:16:"number_of_recurs";N;}s:4:"cart";O:4:"cart":3:{s:5:"items";a:3:{i:0;O:4:"item":5:{s:3:"url";s:29:"https://example.net/item?id=
    1";s:11:"description";s:6:"item 1";s:12:"product_code";s:1:"1";s:9:"unit_cost";s:3:"100";s:8:"quantity";s:1:"1";}i:1;O:4:"item":5:{s:3:"url";s:29:"https://example.net/item?id=2";s:11:"description";s:6:"item
    2";s:12:"product_code";s:1:"2";s:9:"unit_cost";s:3:"200";s:8:"quantity";s:1:"1";}i:2;O:4:"item":5:{s:3:"url";s:41:"https://custom.url.exmple.net/olditems/33";s:11:"description";s:6:"item
    3";s:12:"product_code";s:1:"3";s:9:"unit_cost";s:2:"50";s:8:"quantity";s:1:"2";}}s:8:"subtotal";s:6:"400.00";s:3:"tax";O:3:"tax":3:{s:6:"amount";s:5:"52.00";s:11:"description";s:3:"Tax";s:4:"rate";s:5:"13.00";}}s:15:"contact_details";O:14:"contactdetails"
    :4:{s:10:"first_name";N;s:9:"last_name";N;s:5:"email";N;s:5:"phone";N;}s:16:"shipping_details";O:7:"address":6:{s:9:"address_1";N;s:9:"address_2";N;s:4:"city";N;s:8:"province";N;s:7:"country";N;s:11:"postal_code";N;}s:15:"billing_details";O:7:"address":6:
    {s:9:"address_1";N;s:9:"address_2";N;s:4:"city";N;s:8:"province";N;s:7:"country";N;s:11:"postal_code";N;}}

    when you need it again as an object you just run:
    $order = unserialize($_SESSION['serialized_order']);

    as the customer won't be able to modify the serialized data, you don't
    need to think about validating the incoming data, it's a completely
    different history if the serialized data had been posted.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Tue Mar 7 22:53:23 2023
    J.O. Aho <user@example.net> wrote:
    : On 3/7/23 17:43, The Doctor wrote:
    : > The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    : > : J.O. Aho <user@example.net> wrote:
    : > : : On 3/5/23 01:52, The Doctor wrote:
    : > : : > In article <k6i6l8FksscU2@mid.individual.net>,
    : > : : > J.O. Aho <user@example.net> wrote:
    : > : : >> On 3/5/23 00:58, The Doctor wrote:
    : > : : >>> J.O. Aho <user@example.net> wrote:
    : > : : >>
    : > : : >>> : https://pastebin.com/bF6bZseu
    : > : : >>> : Keep in mind nothin is a 100% solution for your issue as I haven't
    : > : : >>> : bothered really go into the API that is used but just a bit based on
    : > : : >>> : your posts in this group.
    : > : : >>>
    : > : : >>> : And please, what ever you do, don't go with the str_replace, it's not
    : > : : >>> : the solution to your issue, it will just make things a lot harder to
    : > : : >>> : maintain.
    : > : : >>>
    : > : : >>>
    : > : : >>> Actually the class approach works better.
    : > : : >>
    : > : : >> That's good, just tweak it to fit your user case, just don't forget : > : : >> validate the input data.
    : > : : >>
    : > : : >>
    : > : : >>> Too bad Google does not pick that up
    : > : : >>> in their searches for JSON>
    : > : : >>
    : > : : >> Much depends on the requirements and what the json is used for, say : > : : >> sending data between angular and php, then the coder is usually in
    : > : : >> control of both front end and backend and can use what ever json format
    : > : : >> they want, but it's different when you have to follow an API, but
    : > : : >> usually you can get support from the API owner and payment services tend
    : > : : >> to also do a verification round before letting you to use production : > : : >> grade transactions.
    : > : : >>
    : > : : >
    : > : : > A good article can be written about this.
    : >
    : > : : Great, post the link when you have written it ;)
    : >
    : > : : It's about time, to write a good example that make sense without bad
    : > : : coding and then host and promote the page, not everyone is prepared to : > : : do that.
    : >
    : > : : Sadly we see a lot of cheap cut the corner stuff out on the net, much
    : > : : for people have sample with simple structures so arrays works ok, but
    : > : : that is much based on the quality of the education they had. For example
    : > : : there is a country that spits out 2 million CS each year, many of them : > : : have a skills level not much than general high school students
    : > : : programing knowledge level. Should also note that there are really good : > : : programmers from that country too.
    : >
    : > : : The main thing is that you get forward on your project.
    : >
    : >
    : > : Wait until you see the nightmare in bureaucracy.
    : >
    : > Other nightmare, I might have to write a preview page.

    : I would make a function that can update an existing item in the orders
    : cart, similar to the one AddItem, with the tweak that if the quantity is
    : 0 then it removes the item. Lets call the function for UpdateItem.

    : In the overview page you do as before, create the order object,
    : serialize it and store in the session.

    : On the overview page you have to have some ajax calls, so that you can
    : increase and decrease the quantity of items and of course delete. In the
    : ajax call you need to send the project_code and also the new quantity.

    : The php script will unserailize the order from session, do the
    : changes, serialize the order and store it in session before sending
    : response with the new order->txn_total, order->cart->subtotal, and
    : order->cart->tax->amount

    : You will then use javascript on the overview page to remove items and
    : also update the values.

    : When the customer want to proceed, you just go to the next page and you
    : unserialize the order and use it as you did before to send it to the
    : payment service.

    : With help of Ajax, you can make things quite neat and maybe even avoid
    : many unnecessary load of "full php pages". Use some framework if
    : possible, I would give you just one advice, avoid angular, as you need
    : to keep on updating it quite frequently.

    : - - - - -

    : if we have the order object we had in the examples earlier in the thread
    : then you just serialize it with: $serialized_order = serialize($order);
    : and the string would look like:

    : O:5:"order":20:{s:16:"order_tax_rate";d:0.13;s:16:"order_subtotal";d:400;s:16:"order_taxtotal";d:52;s:8:"store_id";N;s:9:"api_token";N;s:11:"checkout_id";N;s:9:"txn_total";s:6:"452.00";s:11:"environment";N;s:6:"action";N;s:5:"token";a:2:{i:0;O:5:"token"
    :2:{s:8:"data_key";s:4:"1234";s:9:"issuer_id";s:16:"645sddfvdrt4tefd";}i:1;O:5:"token":2:{s:8:"data_key";s:4:"5678";s:9:"issuer_id";s:16:"645sddfvdrt4tefd";}}s:7:"ask_cvv";N;s:8:"order_no";N;s:7:"cust_id";N;s:18:"dynamic_descriptor";N;s:8:"language";N;s:
    5:"recur";O:5:"recur":6:{s:8:"bill_now";N;s:12:"recur_amount";N;s:10:"start_date";N;s:10:"recur_unit";N;s:12:"recur_period";N;s:16:"number_of_recurs";N;}s:4:"cart";O:4:"cart":3:{s:5:"items";a:3:{i:0;O:4:"item":5:{s:3:"url";s:29:"https://example.net/item?
    id=1";s:11:"description";s:6:"item
    : 1";s:12:"product_code";s:1:"1";s:9:"unit_cost";s:3:"100";s:8:"quantity";s:1:"1";}i:1;O:4:"item":5:{s:3:"url";s:29:"https://example.net/item?id=2";s:11:"description";s:6:"item
    : 2";s:12:"product_code";s:1:"2";s:9:"unit_cost";s:3:"200";s:8:"quantity";s:1:"1";}i:2;O:4:"item":5:{s:3:"url";s:41:"https://custom.url.exmple.net/olditems/33";s:11:"description";s:6:"item
    : 3";s:12:"product_code";s:1:"3";s:9:"unit_cost";s:2:"50";s:8:"quantity";s:1:"2";}}s:8:"subtotal";s:6:"400.00";s:3:"tax";O:3:"tax":3:{s:6:"amount";s:5:"52.00";s:11:"description";s:3:"Tax";s:4:"rate";s:5:"13.00";}}s:15:"contact_details";O:14:"
    contactdetails":4:{s:10:"first_name";N;s:9:"last_name";N;s:5:"email";N;s:5:"phone";N;}s:16:"shipping_details";O:7:"address":6:{s:9:"address_1";N;s:9:"address_2";N;s:4:"city";N;s:8:"province";N;s:7:"country";N;s:11:"postal_code";N;}s:15:"billing_details";
    O:7:"address":6:{s:9:"address_1";N;s:9:"address_2";N;s:4:"city";N;s:8:"province";N;s:7:"country";N;s:11:"postal_code";N;}}

    : when you need it again as an object you just run:
    : $order = unserialize($_SESSION['serialized_order']);

    : as the customer won't be able to modify the serialized data, you don't
    : need to think about validating the incoming data, it's a completely
    : different history if the serialized data had been posted.

    Will take time to look at this suggestion.

    Javascript and I barely get along.

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Fools presume to know all; the wise know they do not. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ezimene nimi Teine nimi@21:1/5 to All on Wed Mar 8 09:22:30 2023
    4qCA4qCA4qCA4qCA4qCAR29vZCDioIDioIDioIBldmVuaW5n4qCA4qCA4qCA4qCALOKggOKggOKg gEouIE8uIEFob+KggOKggOKggC4K4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA 4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCACuKggOKggOKg gOKggOKggEFyZSDioIDioIDioIBZb3Ug4qCA4qCA4qCAcmljaOKggOKggCA/IOKggOKggElmIOKg gOKggOKggHllc+KggOKggOKggCzioIDioIDioIB3b3VsZCDioIDioIBZb3Ug4qCA4qCAaGVscCDi oIDioIDioIBtZSDioIDioIBmaW5hbmNpYWxseeKggD8g4qCA4qCA4qCASSdtIOKggOKggOKggGhh dmluZyDioIDioIDioIBubyDioIDioIDioIBqb2Ig4qCA4qCAbW9tZW50YXJpbHnioIDioIAuCuKg gOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggArioIDioIDi oIDioIDioIBJJ2Qg4qCA4qCA4qCAbGlrZSDioIDioIDioIB0byDioIDioIBidXkg4qCA4qCA4qCA bmV3ZXIg4qCA4qCAbW9iaWxlIOKggOKggOKggHBob25l4qCAKOKggElQaG9uZSAxNOKggCnioIDi oIAuIOKggOKggEknbSDioIDioIBoYXZpbmcg4qCA4qCA4qCAbW9tZW50YXJpbHkg4qCA4qCA4qCA b2xk4qCA4qCAIElQaG9uZSA1c+KggOKggC4K4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA CuKggOKggOKggOKggOKggDExMDAg4qCA4qCAZG9sbGFycyDioIDioIB3b3VsZCDioIDioIBiZSDi oIDioIBiaWcg4qCAaGVscOKggC4K4qCA4qCA4qCA4qCA4qCACuKggOKggOKggOKggOKggFN0YXni oIDioIAgY29udGludWVpbmdseSDioIDioIDioIBzaGluaW5n4qCA4qCA4qCALOKggOKggOKggEou Ty4gQWhv4qCA4qCA4qCAIQrioIAK4qCACuKggOKggOKggOKggOKggEd1eeKggCBmcm9tIOKggFZp bGphbmRp4qCA4qCAKOKggOKggEvioIDioIDioIDioIDioIBy4qCA4qCA4qCA4qCA4qCA4qCAaeKg gOKggOKggOKggOKggOKggHPioIDioIDioIDioIDioIDioIB04qCA4qCA4qCA4qCA4qCAauKggOKg gOKggOKggGHioIDioIDioIBuIOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKg gOKggFLioIDioIDioIDioIDioIBv4qCA4qCA4qCA4qCAYuKggOKggOKggGHioIDioIDioIDioIBt 4qCA4qCA4qCA4qCAKQrioIAK4qCACuKggArioIAK4qCACuKggArioIDioIAK4qCACuKggArioIAK 4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggAri oIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKg gArioIAK4qCACuKggArioIAK4qCACuKggOKggAoKCk9uIFRodXJzZGF5LCBNYXJjaCAyLCAyMDIz IGF0IDM6MjM6NDbigK9QTSBVVEMrMiwgSi5PLiBBaG8gd3JvdGU6Cj4gT24gMy8yLzIzIDEzOjQ0 LCBUaGUgRG9jdG9yIHdyb3RlOiAKPiAKPiBBIHdpbGQgZ3Vlc3MsIHRoaXMgc3RpbGwgdG8gZG8g d2l0aCB5b3VyIGpzb24sIHdoaWNoIHlvdSBoYXZlIGFza2VkIGhlbHAgCj4gd2l0aCBxdWl0ZSBv ZnRlbi4KPiA+IEkgd2lzaCB0byByZXBsYWNlIFtbIHdpdGggWyAKPiA+IAo+ID4gQU5EIAo+ID4g Cj4gPiBdXSB3aXRoIF0gaW4gYW4gYXNzb2NpYXRpdmUgYXJyYXkgLgo+IERvbid0IHN0b3JlIG9i amVjdHMgYXMgYW4gYXJyYXkgYW5kIHBsYWNlIHRob3NlIGFycmF5cyBpbiBhbiBhcnJheS4gCj4g Cj4gQ3JlYXRlIGFuIG9iamVjdCBhbmQgcGxhY2UgdGhlIG9iamVjdCBpbnRvIHRoZSBhcnJheSB3 aGljaCBpcyBwYXJ0IG9mIAo+IHlvdXIgbWFpbi1vYmplY3QuCj4gPiBIb3cgY2FuIEkgZG8gdGhp cz8KPiBJZiB5b3UganVzdCBsb29rIGF0IGEgc3RyaW5nLCBzdHJpbmcgcmVwbGFjZSBjb3VsZCB3 b3JrIHF1aXRlIHdlbGwgdG8gZG8gCj4gdGhpcyAKPiBzdHJfcmVwbGFjZSgnW1snLCdbJywkc3Ry KTsK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Wed Mar 8 23:44:51 2023
    The Doctor, 2023-03-05 00:58:

    [...]
    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    Well - programming is about to *learn* how to do things and not about
    "look at Google if there is a solution for it".


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Arno Welzel on Thu Mar 9 01:25:08 2023
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-05 00:58:

    : [...]
    : > Actually the class approach works better.
    : >
    : > Too bad Google does not pick that up
    : > in their searches for JSON>

    : Well - programming is about to *learn* how to do things and not about
    : "look at Google if there is a solution for it".

    Too bad all roads pint to Google.

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Hiding reality from people is no way to deal with reality. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Ezimene nimi Teine nimi on Thu Mar 9 01:24:40 2023
    Ezimene nimi Teine nimi <techfan55555@hotmail.com> wrote:
    : 4qCA4qCA4qCA4qCA4qCAR29vZCDioIDioIDioIBldmVuaW5n4qCA4qCA4qCA4qCALOKggOKggOKg : gEouIE8uIEFob+KggOKggOKggC4K4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA : 4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCACuKggOKggOKg : gOKggOKggEFyZSDioIDioIDioIBZb3Ug4qCA4qCA4qCAcmljaOKggOKggCA/IOKggOKggElmIOKg : gOKggOKggHllc+KggOKggOKggCzioIDioIDioIB3b3VsZCDioIDioIBZb3Ug4qCA4qCAaGVscCDi : oIDioIDioIBtZSDioIDioIBmaW5hbmNpYWxseeKggD8g4qCA4qCA4qCASSdtIOKggOKggOKggGhh : dmluZyDioIDioIDioIBubyDioIDioIDioIBqb2Ig4qCA4qCAbW9tZW50YXJpbHnioIDioIAuCuKg : gOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggArioIDioIDi : oIDioIDioIBJJ2Qg4qCA4qCA4qCAbGlrZSDioIDioIDioIB0byDioIDioIBidXkg4qCA4qCA4qCA : bmV3ZXIg4qCA4qCAbW9iaWxlIOKggOKggOKggHBob25l4qCAKOKggElQaG9uZSAxNOKggCnioIDi : oIAuIOKggOKggEknbSDioIDioIBoYXZpbmcg4qCA4qCA4qCAbW9tZW50YXJpbHkg4qCA4qCA4qCA : b2xk4qCA4qCAIElQaG9uZSA1c+KggOKggC4K4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA : CuKggOKggOKggOKggOKggDExMDAg4qCA4qCAZG9sbGFycyDioIDioIB3b3VsZCDioIDioIBiZSDi : oIDioIBiaWcg4qCAaGVscOKggC4K4qCA4qCA4qCA4qCA4qCACuKggOKggOKggOKggOKggFN0YXni : oIDioIAgY29udGludWVpbmdseSDioIDioIDioIBzaGluaW5n4qCA4qCA4qCALOKggOKggOKggEou : Ty4gQWhv4qCA4qCA4qCAIQrioIAK4qCACuKggOKggOKggOKggOKggEd1eeKggCBmcm9tIOKggFZp : bGphbmRp4qCA4qCAKOKggOKggEvioIDioIDioIDioIDioIBy4qCA4qCA4qCA4qCA4qCA4qCAaeKg : gOKggOKggOKggOKggOKggHPioIDioIDioIDioIDioIDioIB04qCA4qCA4qCA4qCA4qCAauKggOKg : gOKggOKggGHioIDioIDioIBuIOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKg : gOKggFLioIDioIDioIDioIDioIBv4qCA4qCA4qCA4qCAYuKggOKggOKggGHioIDioIDioIDioIBt : 4qCA4qCA4qCA4qCAKQrioIAK4qCACuKggArioIAK4qCACuKggArioIDioIAK4qCACuKggArioIAK : 4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggAri : oIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKggArioIAK4qCACuKg : gArioIAK4qCACuKggArioIAK4qCACuKggOKggAoKCk9uIFRodXJzZGF5LCBNYXJjaCAyLCAyMDIz : IGF0IDM6MjM6NDbigK9QTSBVVEMrMiwgSi5PLiBBaG8gd3JvdGU6Cj4gT24gMy8yLzIzIDEzOjQ0 : LCBUaGUgRG9jdG9yIHdyb3RlOiAKPiAKPiBBIHdpbGQgZ3Vlc3MsIHRoaXMgc3RpbGwgdG8gZG8g : d2l0aCB5b3VyIGpzb24sIHdoaWNoIHlvdSBoYXZlIGFza2VkIGhlbHAgCj4gd2l0aCBxdWl0ZSBv : ZnRlbi4KPiA+IEkgd2lzaCB0byByZXBsYWNlIFtbIHdpdGggWyAKPiA+IAo+ID4gQU5EIAo+ID4g : Cj4gPiBdXSB3aXRoIF0gaW4gYW4gYXNzb2NpYXRpdmUgYXJyYXkgLgo+IERvbid0IHN0b3JlIG9i : amVjdHMgYXMgYW4gYXJyYXkgYW5kIHBsYWNlIHRob3NlIGFycmF5cyBpbiBhbiBhcnJheS4gCj4g : Cj4gQ3JlYXRlIGFuIG9iamVjdCBhbmQgcGxhY2UgdGhlIG9iamVjdCBpbnRvIHRoZSBhcnJheSB3 : aGljaCBpcyBwYXJ0IG9mIAo+IHlvdXIgbWFpbi1vYmplY3QuCj4gPiBIb3cgY2FuIEkgZG8gdGhp : cz8KPiBJZiB5b3UganVzdCBsb29rIGF0IGEgc3RyaW5nLCBzdHJpbmcgcmVwbGFjZSBjb3VsZCB3 : b3JrIHF1aXRlIHdlbGwgdG8gZG8gCj4gdGhpcyAKPiBzdHJfcmVwbGFjZSgnW1snLCdbJywkc3Ry : KTsK

    This abusive spamtroll came from

    X-Received: by 2002:a05:620a:d4d:b0:742:83ee:f569 with SMTP id o13-20020a05620a 0d4d00b0074283eef569mr4089391qkl.13.1678296151146;
    Wed, 08 Mar 2023 09:22:31 -0800 (PST)
    X-Received: by 2002:a81:ac1a:0:b0:533:cf4e:9a80 with SMTP id
    k26-20020a81ac1a000000b00533cf4e9a80mr11627665ywh.6.1678296150894; Wed, 08
    Mar 2023 09:22:30 -0800 (PST)
    Path: news.nk.ca!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.c
    om!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!new
    s.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!g
    oogle-groups.googlegroups.com!not-for-mail
    Newsgroups: comp.lang.php
    Date: Wed, 8 Mar 2023 09:22:30 -0800 (PST)
    In-Reply-To: <k6bmapFcv37U1@mid.individual.net>
    Injection-Info: google-groups.googlegroups.com; posting-host=85.253.192.155; po
    sting-account=ogslnwoAAACd9vU9PADzlWBA81fSuNpL
    NNTP-Posting-Host: 85.253.192.155
    References: <ttq5np$i9r$50@gallifrey.nk.ca> <k6bmapFcv37U1@mid.individual.net>
    User-Agent: G2/1.0
    MIME-Version: 1.0
    Message-ID: <b0085144-a1fa-4a4d-9f5c-538892d94c39n@googlegroups.com>
    Subject: Re: Replace punctuation in an associative array
    From: Ezimene nimi Teine nimi <techfan55555@hotmail.com>
    Injection-Date: Wed, 08 Mar 2023 17:22:31 +0000
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: base64
    X-Received-Bytes: 3833
    Xref: news.nk.ca comp.lang.php:167980



    Spamtrollers are trolls posting useless spam thinking it is content
    but are posting useless noise. Spamtrolls are newsgroup vandals!
    Thoses trolls are as bad as Donald
    Trump on Twitter.

    This makes https://groups.google.com/search/conversations?q=Depeer%20Google%20Groups

    Depeer Google groups Now!!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Hiding reality from people is no way to deal with reality. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Fri Mar 10 09:08:41 2023
    The Doctor, 2023-03-09 02:25:

    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-05 00:58:

    : [...]
    : > Actually the class approach works better.
    : >
    : > Too bad Google does not pick that up
    : > in their searches for JSON>

    : Well - programming is about to *learn* how to do things and not about
    : "look at Google if there is a solution for it".

    Too bad all roads pint to Google.

    No in my life. I started learning programming long before Google even
    existed.

    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to Arno Welzel on Fri Mar 10 15:20:33 2023
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-09 02:25:

    : > Arno Welzel <usenet@arnowelzel.de> wrote:
    : > : The Doctor, 2023-03-05 00:58:
    : >
    : > : [...]
    : > : > Actually the class approach works better.
    : > : >
    : > : > Too bad Google does not pick that up
    : > : > in their searches for JSON>
    : >
    : > : Well - programming is about to *learn* how to do things and not about
    : > : "look at Google if there is a solution for it".
    : >
    : > Too bad all roads pint to Google.

    : No in my life. I started learning programming long before Google even
    : existed.

    And that is a very good thing!

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b There is a form of helping that does more harm than doing nothing. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to doctor@doctor.nl2k.ab.ca on Sat Apr 1 14:08:07 2023
    In article <tufhs1$2144$21@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    Arno Welzel <usenet@arnowelzel.de> wrote:
    : The Doctor, 2023-03-09 02:25:

    : > Arno Welzel <usenet@arnowelzel.de> wrote:
    : > : The Doctor, 2023-03-05 00:58:
    : >
    : > : [...]
    : > : > Actually the class approach works better.
    : > : >
    : > : > Too bad Google does not pick that up
    : > : > in their searches for JSON>
    : >
    : > : Well - programming is about to *learn* how to do things and not about
    : > : "look at Google if there is a solution for it".
    : >
    : > Too bad all roads pint to Google.

    : No in my life. I started learning programming long before Google even
    : existed.

    And that is a very good thing!


    The php is correct. The bureaucracy OTOH ...

    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Too proud to be governed is not abiding in the Lord. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From V@21:1/5 to The Doctor on Mon Apr 3 06:55:39 2023
    groups.google.com/g/sci.math/c/sFUlUZ47ZGs



    On Thursday, March 2, 2023 at 2:47:42 PM UTC+2, The Doctor wrote:
    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    How can I do this?

    --
    Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b
    Only an evil person could punish someone for doing good, and only an evil ideology could allow it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to vvvvvvvvvvvvvvvvvvvv11111@mail.ee on Mon Apr 3 14:18:48 2023
    In article <a561e67f-ecd7-4cf0-99e0-26748d63fb89n@googlegroups.com>,
    V <vvvvvvvvvvvvvvvvvvvv11111@mail.ee> wrote: >groups.google.com/g/sci.math/c/sFUlUZ47ZGs



    On Thursday, March 2, 2023 at 2:47:42=E2=80=AFPM UTC+2, The Doctor wrote:
    I wish to replace [[ with [=20
    =20
    AND=20
    =20
    ]] with ] in an associative array .=20
    =20
    How can I do this?=20
    =20
    --=20
    Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca=20
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist r= >ising!=20
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=3D94= >a1f39b=20
    Only an evil person could punish someone for doing good, and only an evil=
    ideology could allow it. -unknown Beware https://mindspring.com

    This abusive spamtroll came from

    comp.lang.php #168006 (1 more)
    X-Received: by 2002:a05:620a:22e2:b0:745:6ab0:b9d4 with SMTP id p2-
    + 20020a05620a22e200b007456ab0b9d4mr7913374qki.3.1680530140578;
    + Mon, 03 Apr 2023 06:55:40 -0700 (PDT)
    X-Received: by 2002:a05:6214:5643:b0:56e:8c9a:2610 with SMTP id
    + mh3-20020a056214564300b0056e8c9a2610mr7491013qvb.3.1680530140114;
    + Mon, 03 Apr
    + 2023 06:55:40 -0700 (PDT)
    Path: news.nk.ca!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting. + com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-
    + media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!
    + postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.php
    Date: Mon, 3 Apr 2023 06:55:39 -0700 (PDT)
    In-Reply-To: <ttq5np$i9r$50@gallifrey.nk.ca>
    Injection-Info: google-groups.googlegroups.com; posting-host=85.253.121.82;
    + posting-account=HfIszAoAAAC8ch6q3uChpTWUALHCfEoF NNTP-Posting-Host: 85.253.121.82
    References: <ttq5np$i9r$50@gallifrey.nk.ca>
    User-Agent: G2/1.0
    MIME-Version: 1.0
    Message-ID: <a561e67f-ecd7-4cf0-99e0-26748d63fb89n@googlegroups.com>
    Subject: Re: Replace punctuation in an associative array
    From: V <vvvvvvvvvvvvvvvvvvvv11111@mail.ee>
    Injection-Date: Mon, 03 Apr 2023 13:55:40 +0000
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable
    X-Received-Bytes: 1799
    Xref: news.nk.ca comp.lang.php:168006


    Spamtrollers are trolls posting useless spam thinking it is content
    but are posting useless noise. Spamtrolls are newsgroup vandals!
    Thoses trolls are as bad as Donald
    Trump on Twitter.

    This makes https://groups.google.com/search/conversations?qÞpeer%20Google%20Groups

    Depeer Google groups Now!!

    Spamtroller , thou art rebuked in the Name of Yahweh the Father,
    Jesus the Son and the Holy Spirit for Jesus has all authority here
    and Satan has no authority here!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t”a1f39b
    The Church must example being a holy bride. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to usenet@arnowelzel.de on Thu Apr 6 00:26:01 2023
    In article <k6shf2F8l9lU1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor, 2023-03-05 00:58:

    [...]
    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    Well - programming is about to *learn* how to do things and not about
    "look at Google if there is a solution for it".


    Bureaucracy said they are doing the job, but the customer is not happy.

    Can I create an intermediary state
    so just just before the customer hits the pay button,
    they are review what they are sending?


    --
    Arno Welzel
    https://arnowelzel.de



    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b All words are devalued in the mouth of the liar. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to The Doctor on Wed Apr 12 22:45:28 2023
    In article <u0l3ip$1e4l$2@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <k6shf2F8l9lU1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor, 2023-03-05 00:58:

    [...]
    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    Well - programming is about to *learn* how to do things and not about
    "look at Google if there is a solution for it".


    Bureaucracy said they are doing the job, but the customer is not happy.

    Can I create an intermediary state
    so just just before the customer hits the pay button,
    they are review what they are sending?


    Try to pass a json from 1 form to another.


    --
    Arno Welzel
    https://arnowelzel.de



    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b >All words are devalued in the mouth of the liar. -unknown Beware >https://mindspring.com


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b They who demand you ignore the elephant in the room are not working with your best interests in mind. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Thu Apr 13 07:41:53 2023
    On 4/13/23 00:45, The Doctor wrote:
    In article <u0l3ip$1e4l$2@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <k6shf2F8l9lU1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor, 2023-03-05 00:58:

    [...]
    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    Well - programming is about to *learn* how to do things and not about
    "look at Google if there is a solution for it".


    Bureaucracy said they are doing the job, but the customer is not happy.

    Can I create an intermediary state
    so just just before the customer hits the pay button,
    they are review what they are sending?


    Try to pass a json from 1 form to another.

    This is why you have session cookies, no point of passing data from a
    form to another.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Thu Apr 13 11:50:07 2023
    In article <k9pj11Fmrd5U2@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 4/13/23 00:45, The Doctor wrote:
    In article <u0l3ip$1e4l$2@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <k6shf2F8l9lU1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor, 2023-03-05 00:58:

    [...]
    Actually the class approach works better.

    Too bad Google does not pick that up
    in their searches for JSON>

    Well - programming is about to *learn* how to do things and not about
    "look at Google if there is a solution for it".


    Bureaucracy said they are doing the job, but the customer is not happy.

    Can I create an intermediary state
    so just just before the customer hits the pay button,
    they are review what they are sending?


    Try to pass a json from 1 form to another.

    This is why you have session cookies, no point of passing data from a
    form to another.


    I have

    <?=session_start();
    error_reporting(E_ALL);


    So I need to add a specific cookie/ token ?

    --
    //Aho




    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Giving can be overdone, as well as underdone. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Thu Apr 13 14:26:19 2023
    On 4/13/23 13:50, The Doctor wrote:
    In article J.O. Aho <user@example.net> wrote:

    Try to pass a json from 1 form to another.

    This is why you have session cookies, no point of passing data from a
    form to another.


    I have

    <?=session_start();
    error_reporting(E_ALL);


    So I need to add a specific cookie/ token ?

    You just use the $_SESSION to store and fetch data as I mentioned in my
    post from 7th of March.


    The page you posted the values to:

    $_SESSION['serialized_order'] = serialize($order);

    and on the page where you need all the data:

    $order = unserialize($_SESSION['serialized_order']);

    if you need to modify the data, then read it from the session and then
    store it back to the session.

    Keep in mind the session data is never sent to the browser, so the user
    can't adjust the data on their side.

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Thu Apr 13 22:37:18 2023
    In article <k9qanbFqbf1U1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 4/13/23 13:50, The Doctor wrote:
    In article J.O. Aho <user@example.net> wrote:

    Try to pass a json from 1 form to another.

    This is why you have session cookies, no point of passing data from a
    form to another.


    I have

    <?=session_start();
    error_reporting(E_ALL);


    So I need to add a specific cookie/ token ?

    You just use the $_SESSION to store and fetch data as I mentioned in my
    post from 7th of March.


    The page you posted the values to:

    $_SESSION['serialized_order'] = serialize($order);

    and on the page where you need all the data:

    $order = unserialize($_SESSION['serialized_order']);

    if you need to modify the data, then read it from the session and then
    store it back to the session.

    Keep in mind the session data is never sent to the browser, so the user
    can't adjust the data on their side.


    Will review.
    --
    //Aho


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b She didn't want to be evil, but by denying her nature she adopted it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to All on Fri Apr 14 01:12:19 2023
    95% there.


    Now I have split the form successfully I need to get
    the cartitem in a printable format.

    So given when I have worked on


    <?=session_start();
    error_reporting(E_ALL);

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <link rel="stylesheet" type="text/css" href="css/css2.css"/>
    </head>
    <?php
    if(!empty($_SESSION['sessiondata'])){
    }

    <?php
    $myObj = [];
    $storevalues= array();
    $cartarray= array();
    $cart= array();
    $contact1=array();
    $contact_details=array();
    $shipping1=array();
    $shipping_details=array();
    $billing1=array();
    $billing_details=array();
    $arr2 =array();

    class Storevs{
    }
    class Item
    {
    }
    class TaxItem
    {
    }

    class CartItem
    {
    public $items;
    public $subtotal;
    public $tax;
    };

    class Contact
    {
    }

    class Shipping
    {
    }

    class Billing
    {
    }

    $items_count = 0;
    $newsubtotal = 0;
    $subtotal = 0;
    $arr = array();

    if (isset($_POST["submit"])){
    $storevalues=(array) $storev;
    }

    if (isset($_POST["submit"])){
    $cartitem= new CartItem();

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    if(isset($_POST['with_gst'][$key])){
    $unit_cost = 63.00;
    }else{
    $unit_cost = 60.00; //no gst included
    }

    $item = new Item();
    $item->url = "https://image";
    $item->description = $_POST['description'][$key];
    $item->product_code = $_POST['id'][$key];
    $item->unit_cost = $unit_cost;
    $item->quantity = $value;
    $cartitem->items[] = $item;

    }
    }



    $cartitem->subtotal = ($_POST['charge_total']/1.05);

    $taxItem = new TaxItem();
    $taxItem->amount = (($_POST['charge_total']/1.05) * 0.05); $taxItem->description = "GST";
    $taxItem->rate = "5.00";
    $cartitem->tax = $taxItem;
    $cart= (array) $cartitem ;
    $cartarray = array( "cart" => $cartitem);
    }

    if (isset($_POST["submit"])){
    $contact=new Contact;
    $contact1= (array) $contact ;
    $contact_details=array ( "contact_details" => $contact1 );
    }
    if (isset($_POST["submit"])){
    $shipping = new Shipping;
    $shipping1 = (array) $shipping;
    $shipping_details=array( "shipping_details" => $shipping1 );
    }
    if (isset($_POST["submit"])){
    $billing = new Billing;
    $billing_details=array( "billing_details" => $billing1 );



    }





    $_SESSION['arr'] = serialize($arr);
    $_SESSION['serialized_Obj'] = serialize($myObj);






    <body>
    <form action="https://www.nk.ca/pdsolutions/step5b.php" method="post" >

    <h2> Please review your order!</h2>
    <?php
    echo "<br /><br />";
    echo "<h3> Contact Information </h3>";

    echo "<br /> My name is " . $contact->first_name . " " . $contact->last_name . "<br />";
    echo "My E-mail address is " . $contact->email . " <br />";
    echo "You can call me at " . $contact->phone . " <br /> <br />";

    echo "<h3> Billing Information </h3>";

    echo "<br /> Address :" . $billing->address_1 . "<br />";
    echo $billing->address_2 . "<br />";
    echo "Municipality:" . $billing->city . "<br />";
    echo "Province:" . $billing->province . "<br />";
    echo "Postal Code:" . $billing->postal_code . "<br /><br />";

    echo "<h3> Shipping Information </h3>";

    echo "<br /> Address :" . $shipping->address_1 . "<br />";
    echo $shipping->address_2 . "<br />";
    echo "Municipality:" . $shipping->city . "<br />";
    echo "Province:" . $shipping->province . "<br />";
    echo "Postal Code:" . $shipping->postal_code . "<br /><br />";



    echo "<h3> Course Information </h3>";





    <input type="submit" value="Place Your Order" name="submit" id="submit" >
    <input onclick="history.back()" type="reset" value="Clear the Form" id="reset" />
    </form>
    </body>
    </html>

    Excised only for the needed information.

    The Course information is in the cart items.

    How do I present to the customer what is in the cart / what
    they are ordering?
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b She didn't want to be evil, but by denying her nature she adopted it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Fri Apr 14 19:34:23 2023
    On 4/14/23 03:12, The Doctor wrote:
    95% there.


    Now I have split the form successfully I need to get
    the cartitem in a printable format.

    So given when I have worked on


    <?=session_start();
    error_reporting(E_ALL);

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <link rel="stylesheet" type="text/css" href="css/css2.css"/>
    </head>
    <?php
    if(!empty($_SESSION['sessiondata'])){
    }

    <?php
    $myObj = [];
    $storevalues= array();
    $cartarray= array();
    $cart= array();
    $contact1=array();
    $contact_details=array();
    $shipping1=array();
    $shipping_details=array();
    $billing1=array();
    $billing_details=array();
    $arr2 =array();

    Try to avoid all these arrays, they don't make life easier.

    class Storevs{
    }
    class Item
    {
    }
    class TaxItem
    {
    }

    class CartItem
    {
    public $items;
    public $subtotal;
    public $tax;
    };

    class Contact
    {
    }

    class Shipping
    {
    }

    class Billing
    {
    }

    Don't define the classes here, then you need to do it each file you use,
    you create an php script that just includes the classes and then use include https://www.php.net/manual/en/function.include.php

    $items_count = 0;
    $newsubtotal = 0;
    $subtotal = 0;
    $arr = array();

    if (isset($_POST["submit"])){
    $storevalues=(array) $storev;
    }

    if (isset($_POST["submit"])){
    $cartitem= new CartItem();

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    if(isset($_POST['with_gst'][$key])){
    $unit_cost = 63.00;
    }else{
    $unit_cost = 60.00; //no gst included
    }

    prices shouldn't be hard coded, you don't want to change the code just
    for the price went up due of inflation, you change the price in a
    database of some sort.

    $item = new Item();
    $item->url = "https://image";
    $item->description = $_POST['description'][$key];
    $item->product_code = $_POST['id'][$key];
    $item->unit_cost = $unit_cost;
    $item->quantity = $value;
    $cartitem->items[] = $item;

    }
    }

    $cartitem->subtotal = ($_POST['charge_total']/1.05);

    Hey, this ain't a value you can trust, you need to go trough all the
    items in the cart, check up the price for each item and calculate the total.

    Say a user with one of the many browser plugins that allows you to
    modify post data, the user just adds all the items it wants and then
    change the value for charge_total to 0, please calculate how pissed your
    boss will be.


    $taxItem = new TaxItem();
    $taxItem->amount = (($_POST['charge_total']/1.05) * 0.05); $taxItem->description = "GST";
    $taxItem->rate = "5.00";
    $cartitem->tax = $taxItem;
    $cart= (array) $cartitem ;
    $cartarray = array( "cart" => $cartitem);
    }

    if (isset($_POST["submit"])){
    $contact=new Contact;
    $contact1= (array) $contact ;
    $contact_details=array ( "contact_details" => $contact1 );
    }
    if (isset($_POST["submit"])){
    $shipping = new Shipping;
    $shipping1 = (array) $shipping;
    $shipping_details=array( "shipping_details" => $shipping1 );
    }
    if (isset($_POST["submit"])){
    $billing = new Billing;
    $billing_details=array( "billing_details" => $billing1 );

    }

    $_SESSION['arr'] = serialize($arr);
    $_SESSION['serialized_Obj'] = serialize($myObj);



    <body>
    <form action="https://www.nk.ca/pdsolutions/step5b.php" method="post" >

    <h2> Please review your order!</h2>
    <?php
    echo "<br /><br />";

    why do you echo the html code? leave those outside the php code, you can
    have multiple <?php ?> in a page.

    echo "<h3> Contact Information </h3>";

    echo "<br /> My name is " . $contact->first_name . " " . $contact->last_name . "<br />";
    echo "My E-mail address is " . $contact->email . " <br />";
    echo "You can call me at " . $contact->phone . " <br /> <br />";

    echo "<h3> Billing Information </h3>";

    echo "<br /> Address :" . $billing->address_1 . "<br />";
    echo $billing->address_2 . "<br />";
    echo "Municipality:" . $billing->city . "<br />";
    echo "Province:" . $billing->province . "<br />";
    echo "Postal Code:" . $billing->postal_code . "<br /><br />";

    echo "<h3> Shipping Information </h3>";

    echo "<br /> Address :" . $shipping->address_1 . "<br />";
    echo $shipping->address_2 . "<br />";
    echo "Municipality:" . $shipping->city . "<br />";
    echo "Province:" . $shipping->province . "<br />";
    echo "Postal Code:" . $shipping->postal_code . "<br /><br />";



    echo "<h3> Course Information </h3>";

    Here you use a foreach loop that goes over the cart items, of course you
    need to deserialize the $_SESSION['serialized_Obj']. https://www.php.net/manual/en/control-structures.foreach.php



    <input type="submit" value="Place Your Order" name="submit" id="submit" >
    <input onclick="history.back()" type="reset" value="Clear the Form" id="reset" />
    </form>
    </body>
    </html>

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Fri Apr 14 22:21:34 2023
    In article <k9th4vFauniU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 4/14/23 03:12, The Doctor wrote:
    95% there.


    Now I have split the form successfully I need to get
    the cartitem in a printable format.

    So given when I have worked on


    <?=session_start();
    error_reporting(E_ALL);

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, >maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <link rel="stylesheet" type="text/css" href="css/css2.css"/>
    </head>
    <?php
    if(!empty($_SESSION['sessiondata'])){
    }

    <?php
    $myObj = [];
    $storevalues= array();
    $cartarray= array();
    $cart= array();
    $contact1=array();
    $contact_details=array();
    $shipping1=array();
    $shipping_details=array();
    $billing1=array();
    $billing_details=array();
    $arr2 =array();

    Try to avoid all these arrays, they don't make life easier.

    class Storevs{
    }
    class Item
    {
    }
    class TaxItem
    {
    }

    class CartItem
    {
    public $items;
    public $subtotal;
    public $tax;
    };

    class Contact
    {
    }

    class Shipping
    {
    }

    class Billing
    {
    }

    Don't define the classes here, then you need to do it each file you use,
    you create an php script that just includes the classes and then use include >https://www.php.net/manual/en/function.include.php

    $items_count = 0;
    $newsubtotal = 0;
    $subtotal = 0;
    $arr = array();

    if (isset($_POST["submit"])){
    $storevalues=(array) $storev;
    }

    if (isset($_POST["submit"])){
    $cartitem= new CartItem();

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    if(isset($_POST['with_gst'][$key])){
    $unit_cost = 63.00;
    }else{
    $unit_cost = 60.00; //no gst included
    }

    prices shouldn't be hard coded, you don't want to change the code just
    for the price went up due of inflation, you change the price in a
    database of some sort.

    $item = new Item();
    $item->url = "https://image";
    $item->description = $_POST['description'][$key];
    $item->product_code = $_POST['id'][$key];
    $item->unit_cost = $unit_cost;
    $item->quantity = $value;
    $cartitem->items[] = $item;

    }
    }

    $cartitem->subtotal = ($_POST['charge_total']/1.05);

    Hey, this ain't a value you can trust, you need to go trough all the
    items in the cart, check up the price for each item and calculate the total.

    Say a user with one of the many browser plugins that allows you to
    modify post data, the user just adds all the items it wants and then
    change the value for charge_total to 0, please calculate how pissed your
    boss will be.


    $taxItem = new TaxItem();
    $taxItem->amount = (($_POST['charge_total']/1.05) * 0.05);
    $taxItem->description = "GST";
    $taxItem->rate = "5.00";
    $cartitem->tax = $taxItem;
    $cart= (array) $cartitem ;
    $cartarray = array( "cart" => $cartitem);
    }

    if (isset($_POST["submit"])){
    $contact=new Contact;
    $contact1= (array) $contact ;
    $contact_details=array ( "contact_details" => $contact1 );
    }
    if (isset($_POST["submit"])){
    $shipping = new Shipping;
    $shipping1 = (array) $shipping;
    $shipping_details=array( "shipping_details" => $shipping1 );
    }
    if (isset($_POST["submit"])){
    $billing = new Billing;
    $billing_details=array( "billing_details" => $billing1 );

    }

    $_SESSION['arr'] = serialize($arr);
    $_SESSION['serialized_Obj'] = serialize($myObj);



    <body>
    <form action="https://www.nk.ca/pdsolutions/step5b.php" method="post" >

    <h2> Please review your order!</h2>
    <?php
    echo "<br /><br />";

    why do you echo the html code? leave those outside the php code, you can
    have multiple <?php ?> in a page.

    echo "<h3> Contact Information </h3>";

    echo "<br /> My name is " . $contact->first_name . " " . >$contact->last_name . "<br />";
    echo "My E-mail address is " . $contact->email . " <br />";
    echo "You can call me at " . $contact->phone . " <br /> <br />";

    echo "<h3> Billing Information </h3>";

    echo "<br /> Address :" . $billing->address_1 . "<br />";
    echo $billing->address_2 . "<br />";
    echo "Municipality:" . $billing->city . "<br />";
    echo "Province:" . $billing->province . "<br />";
    echo "Postal Code:" . $billing->postal_code . "<br /><br />";

    echo "<h3> Shipping Information </h3>";

    echo "<br /> Address :" . $shipping->address_1 . "<br />";
    echo $shipping->address_2 . "<br />";
    echo "Municipality:" . $shipping->city . "<br />";
    echo "Province:" . $shipping->province . "<br />";
    echo "Postal Code:" . $shipping->postal_code . "<br /><br />";



    echo "<h3> Course Information </h3>";

    Here you use a foreach loop that goes over the cart items, of course you
    need to deserialize the $_SESSION['serialized_Obj']. >https://www.php.net/manual/en/control-structures.foreach.php


    Got you on all accounts!



    <input type="submit" value="Place Your Order" name="submit" id="submit" > >> <input onclick="history.back()" type="reset" value="Clear the
    Form" id="reset" />
    </form>
    </body>
    </html>

    --
    //Aho


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b She didn't want to be evil, but by denying her nature she adopted it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Angel@21:1/5 to The Doctor on Sat Apr 15 05:33:27 2023
    upload.ee/image/15120192/Me.jpg



    On Thursday, March 2, 2023 at 2:47:42 PM UTC+2, The Doctor wrote:
    I wish to replace [[ with [

    AND

    ]] with ] in an associative array .

    How can I do this?

    --
    Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b
    Only an evil person could punish someone for doing good, and only an evil ideology could allow it. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to heyeeeeeeeeeeeeeeeeeee@gmail.com on Sat Apr 15 13:52:35 2023
    In article <d026e061-a4b9-4e25-afe3-48f7ade79bf3n@googlegroups.com>,
    Angel <heyeeeeeeeeeeeeeeeeeee@gmail.com> wrote: >upload.ee/image/15120192/Me.jpg



    On Thursday, March 2, 2023 at 2:47:42=E2=80=AFPM UTC+2, The Doctor wrote:
    I wish to replace [[ with [=20
    =20
    AND=20
    =20
    ]] with ] in an associative array .=20
    =20
    How can I do this?=20
    =20
    --=20
    Member - Liberal International This is doc...@nk.ca Ici doc...@nk.ca=20
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist r= >ising!=20
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=3D94= >a1f39b=20
    Only an evil person could punish someone for doing good, and only an evil=
    ideology could allow it. -unknown Beware https://mindspring.com

    This abusive spamtroll came from

    comp.lang.php #168029
    X-Received: by 2002:ac8:7d16:0:b0:3e6:71d6:5d5c with SMTP id g22-
    + 20020ac87d16000000b003e671d65d5cmr2815576qtb.1.1681562008041;
    + Sat, 15 Apr 2023 05:33:28 -0700 (PDT)
    X-Received: by 2002:a05:6214:8e5:b0:56e:a203:5d1f with SMTP id
    + dr5-20020a05621408e500b0056ea2035d1fmr924852qvb.5.1681562007800;
    + Sat, 15 Apr
    + 2023 05:33:27 -0700 (PDT)
    Path: news.nk.ca!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting. + com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-
    + media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!
    + postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.php
    Date: Sat, 15 Apr 2023 05:33:27 -0700 (PDT)
    In-Reply-To: <ttq5np$i9r$50@gallifrey.nk.ca>
    Injection-Info: google-groups.googlegroups.com; posting-host=82.131.36.154;
    + posting-account=U08oJQoAAADJqJbSiHXlUL7e6UmBUFOe NNTP-Posting-Host: 82.131.36.154
    References: <ttq5np$i9r$50@gallifrey.nk.ca>
    User-Agent: G2/1.0
    MIME-Version: 1.0
    Message-ID: <d026e061-a4b9-4e25-afe3-48f7ade79bf3n@googlegroups.com>
    Subject: Re: Replace punctuation in an associative array
    From: Angel <heyeeeeeeeeeeeeeeeeeee@gmail.com>
    Injection-Date: Sat, 15 Apr 2023 12:33:28 +0000
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable
    X-Received-Bytes: 1788
    Xref: news.nk.ca comp.lang.php:168029

    Spamtrollers are trolls posting useless spam thinking it is content
    but are posting useless noise. Spamtrolls are newsgroup vandals!
    Thoses trolls are as bad as Donald
    Trump on Twitter.

    This makes https://groups.google.com/search/conversations?qÞpeer%20Google%20Groups

    Depeer Google groups Now!!

    Spamtroller , thou art rebuked in the Name of Yahweh the Father,
    Jesus the Son and the Holy Spirit for Jesus has all authority here
    and Satan has no authority here!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t”a1f39b
    The first sign of a true awakening is humility, something the fakers cannot sustain. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to The Doctor on Sun Apr 16 12:40:07 2023
    In article <u1cjle$k24$48@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <k9th4vFauniU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 4/14/23 03:12, The Doctor wrote:
    95% there.


    Now I have split the form successfully I need to get
    the cartitem in a printable format.

    So given when I have worked on


    <?=session_start();
    error_reporting(E_ALL);

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, >>maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <link rel="stylesheet" type="text/css" href="css/css2.css"/>
    </head>
    <?php
    if(!empty($_SESSION['sessiondata'])){
    }

    <?php
    $myObj = [];
    $storevalues= array();
    $cartarray= array();
    $cart= array();
    $contact1=array();
    $contact_details=array();
    $shipping1=array();
    $shipping_details=array();
    $billing1=array();
    $billing_details=array();
    $arr2 =array();

    Try to avoid all these arrays, they don't make life easier.

    class Storevs{
    }
    class Item
    {
    }
    class TaxItem
    {
    }

    class CartItem
    {
    public $items;
    public $subtotal;
    public $tax;
    };

    class Contact
    {
    }

    class Shipping
    {
    }

    class Billing
    {
    }

    Don't define the classes here, then you need to do it each file you use, >>you create an php script that just includes the classes and then use include >>https://www.php.net/manual/en/function.include.php

    $items_count = 0;
    $newsubtotal = 0;
    $subtotal = 0;
    $arr = array();

    if (isset($_POST["submit"])){
    $storevalues=(array) $storev;
    }

    if (isset($_POST["submit"])){
    $cartitem= new CartItem();

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    if(isset($_POST['with_gst'][$key])){
    $unit_cost = 63.00;
    }else{
    $unit_cost = 60.00; //no gst included
    }

    prices shouldn't be hard coded, you don't want to change the code just
    for the price went up due of inflation, you change the price in a
    database of some sort.

    $item = new Item();
    $item->url = "https://image";
    $item->description = $_POST['description'][$key];
    $item->product_code = $_POST['id'][$key];
    $item->unit_cost = $unit_cost;
    $item->quantity = $value;
    $cartitem->items[] = $item;

    }
    }

    $cartitem->subtotal = ($_POST['charge_total']/1.05);

    Hey, this ain't a value you can trust, you need to go trough all the
    items in the cart, check up the price for each item and calculate the total. >>
    Say a user with one of the many browser plugins that allows you to
    modify post data, the user just adds all the items it wants and then
    change the value for charge_total to 0, please calculate how pissed your >>boss will be.


    $taxItem = new TaxItem();
    $taxItem->amount = (($_POST['charge_total']/1.05) * 0.05);
    $taxItem->description = "GST";
    $taxItem->rate = "5.00";
    $cartitem->tax = $taxItem;
    $cart= (array) $cartitem ;
    $cartarray = array( "cart" => $cartitem);
    }

    if (isset($_POST["submit"])){
    $contact=new Contact;
    $contact1= (array) $contact ;
    $contact_details=array ( "contact_details" => $contact1 );
    }
    if (isset($_POST["submit"])){
    $shipping = new Shipping;
    $shipping1 = (array) $shipping;
    $shipping_details=array( "shipping_details" => $shipping1 );
    }
    if (isset($_POST["submit"])){
    $billing = new Billing;
    $billing_details=array( "billing_details" => $billing1 );

    }

    $_SESSION['arr'] = serialize($arr);
    $_SESSION['serialized_Obj'] = serialize($myObj);



    <body>
    <form action="https://www.nk.ca/pdsolutions/step5b.php" method="post" > >>>
    <h2> Please review your order!</h2>
    <?php
    echo "<br /><br />";

    why do you echo the html code? leave those outside the php code, you can >>have multiple <?php ?> in a page.

    echo "<h3> Contact Information </h3>";

    echo "<br /> My name is " . $contact->first_name . " " . >>$contact->last_name . "<br />";
    echo "My E-mail address is " . $contact->email . " <br />";
    echo "You can call me at " . $contact->phone . " <br /> <br />";

    echo "<h3> Billing Information </h3>";

    echo "<br /> Address :" . $billing->address_1 . "<br />";
    echo $billing->address_2 . "<br />";
    echo "Municipality:" . $billing->city . "<br />";
    echo "Province:" . $billing->province . "<br />";
    echo "Postal Code:" . $billing->postal_code . "<br /><br />";

    echo "<h3> Shipping Information </h3>";

    echo "<br /> Address :" . $shipping->address_1 . "<br />";
    echo $shipping->address_2 . "<br />";
    echo "Municipality:" . $shipping->city . "<br />";
    echo "Province:" . $shipping->province . "<br />";
    echo "Postal Code:" . $shipping->postal_code . "<br /><br />";



    echo "<h3> Course Information </h3>";

    Here you use a foreach loop that goes over the cart items, of course you >>need to deserialize the $_SESSION['serialized_Obj']. >>https://www.php.net/manual/en/control-structures.foreach.php


    Got you on all accounts!



    <input type="submit" value="Place Your Order" name="submit" id="submit" >
    <input onclick="history.back()" type="reset" value="Clear the
    Form" id="reset" />
    </form>
    </body>
    </html>

    --
    //Aho




    All right, trying to debug this here is what is happening:

    code snippet

    echo "<h3> Course Information </h3>";
    echo '<pre>'; print_r($cart); echo '</pre>';
    $keys = array_keys($cart);
    print_r($keys);

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    echo "quantity " . $item->quantity . " of " . $item->description
    . " <br />";}
    }
    ?>


    REsult:

    COURSE INFORMATION
    Array
    (
    [items] => Array
    (
    [0] => Item Object
    (
    [url] => https://www.pdsolutions.ca/images/newwhiteheader.png
    [description] => Alberta Legislation Update
    [product_code] => ALU-1304
    [unit_cost] => 60
    [quantity] => 1
    )

    [1] => Item Object
    (
    [url] => https://www.pdsolutions.ca/images/newwhiteheader.png
    [description] => AA training and exam
    [product_code] => AAtt-1306
    [unit_cost] => 60
    [quantity] => 1
    )

    )

    [subtotal] => 320
    [tax] => TaxItem Object
    (
    [amount] => 16
    [description] => GST
    [rate] => 5.00
    )

    )
    Array ( [0] => items [1] => subtotal [2] => tax ) quantity 1 of AA training and exam
    quantity 1 of AA training and exam


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b >She didn't want to be evil, but by denying her nature she adopted it. >-unknown Beware https://mindspring.com


    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b Compulsory enjoyment is unenjoyable. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Sun Apr 16 22:03:34 2023
    On 4/16/23 14:40, The Doctor wrote:
    In article <u1cjle$k24$48@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <k9th4vFauniU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 4/14/23 03:12, The Doctor wrote:
    95% there.


    Now I have split the form successfully I need to get
    the cartitem in a printable format.

    So given when I have worked on


    <?=session_start();
    error_reporting(E_ALL);

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1,
    maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <link rel="stylesheet" type="text/css" href="css/css2.css"/>
    </head>
    <?php
    if(!empty($_SESSION['sessiondata'])){
    }

    <?php
    $myObj = [];
    $storevalues= array();
    $cartarray= array();
    $cart= array();
    $contact1=array();
    $contact_details=array();
    $shipping1=array();
    $shipping_details=array();
    $billing1=array();
    $billing_details=array();
    $arr2 =array();

    Try to avoid all these arrays, they don't make life easier.

    class Storevs{
    }
    class Item
    {
    }
    class TaxItem
    {
    }

    class CartItem
    {
    public $items;
    public $subtotal;
    public $tax;
    };

    class Contact
    {
    }

    class Shipping
    {
    }

    class Billing
    {
    }

    Don't define the classes here, then you need to do it each file you use, >>> you create an php script that just includes the classes and then use include
    https://www.php.net/manual/en/function.include.php

    $items_count = 0;
    $newsubtotal = 0;
    $subtotal = 0;
    $arr = array();

    if (isset($_POST["submit"])){
    $storevalues=(array) $storev;
    }

    if (isset($_POST["submit"])){
    $cartitem= new CartItem();

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){
    if(isset($_POST['with_gst'][$key])){
    $unit_cost = 63.00;
    }else{
    $unit_cost = 60.00; //no gst included
    }

    prices shouldn't be hard coded, you don't want to change the code just
    for the price went up due of inflation, you change the price in a
    database of some sort.

    $item = new Item();
    $item->url = "https://image";
    $item->description = $_POST['description'][$key];
    $item->product_code = $_POST['id'][$key];
    $item->unit_cost = $unit_cost;
    $item->quantity = $value;
    $cartitem->items[] = $item;

    }
    }

    $cartitem->subtotal = ($_POST['charge_total']/1.05);

    Hey, this ain't a value you can trust, you need to go trough all the
    items in the cart, check up the price for each item and calculate the total.

    Say a user with one of the many browser plugins that allows you to
    modify post data, the user just adds all the items it wants and then
    change the value for charge_total to 0, please calculate how pissed your >>> boss will be.


    $taxItem = new TaxItem();
    $taxItem->amount = (($_POST['charge_total']/1.05) * 0.05);
    $taxItem->description = "GST";
    $taxItem->rate = "5.00";
    $cartitem->tax = $taxItem;
    $cart= (array) $cartitem ;
    $cartarray = array( "cart" => $cartitem);
    }

    if (isset($_POST["submit"])){
    $contact=new Contact;
    $contact1= (array) $contact ;
    $contact_details=array ( "contact_details" => $contact1 );
    }
    if (isset($_POST["submit"])){
    $shipping = new Shipping;
    $shipping1 = (array) $shipping;
    $shipping_details=array( "shipping_details" => $shipping1 );
    }
    if (isset($_POST["submit"])){
    $billing = new Billing;
    $billing_details=array( "billing_details" => $billing1 );

    }

    $_SESSION['arr'] = serialize($arr);
    $_SESSION['serialized_Obj'] = serialize($myObj);



    <body>
    <form action="https://www.nk.ca/pdsolutions/step5b.php" method="post" > >>>>
    <h2> Please review your order!</h2>
    <?php
    echo "<br /><br />";

    why do you echo the html code? leave those outside the php code, you can >>> have multiple <?php ?> in a page.

    echo "<h3> Contact Information </h3>";

    echo "<br /> My name is " . $contact->first_name . " " .
    $contact->last_name . "<br />";
    echo "My E-mail address is " . $contact->email . " <br />";
    echo "You can call me at " . $contact->phone . " <br /> <br />";

    echo "<h3> Billing Information </h3>";

    echo "<br /> Address :" . $billing->address_1 . "<br />";
    echo $billing->address_2 . "<br />";
    echo "Municipality:" . $billing->city . "<br />";
    echo "Province:" . $billing->province . "<br />";
    echo "Postal Code:" . $billing->postal_code . "<br /><br />";

    echo "<h3> Shipping Information </h3>";

    echo "<br /> Address :" . $shipping->address_1 . "<br />";
    echo $shipping->address_2 . "<br />";
    echo "Municipality:" . $shipping->city . "<br />";
    echo "Province:" . $shipping->province . "<br />";
    echo "Postal Code:" . $shipping->postal_code . "<br /><br />";



    echo "<h3> Course Information </h3>";

    Here you use a foreach loop that goes over the cart items, of course you >>> need to deserialize the $_SESSION['serialized_Obj'].
    https://www.php.net/manual/en/control-structures.foreach.php


    Got you on all accounts!



    <input type="submit" value="Place Your Order" name="submit" id="submit" >
    <input onclick="history.back()" type="reset" value="Clear the
    Form" id="reset" />
    </form>
    </body>
    </html>

    --
    //Aho




    All right, trying to debug this here is what is happening:

    code snippet

    echo "<h3> Course Information </h3>";
    echo '<pre>'; print_r($cart); echo '</pre>';
    $keys = array_keys($cart);
    print_r($keys);

    foreach ($_POST['quantity'] as $key => $value) {
    if( $value > 0){

    I think this is unnecessary, I wouldn't add an item with quantity of 0
    to the cart.

    echo "quantity " . $item->quantity . " of " . $item->description
    . " <br />";}
    }
    ?>


    REsult:

    COURSE INFORMATION
    Array
    (
    [items] => Array
    (
    [0] => Item Object
    (
    [url] => https://www.pdsolutions.ca/images/newwhiteheader.png
    [description] => Alberta Legislation Update
    [product_code] => ALU-1304
    [unit_cost] => 60
    [quantity] => 1
    )

    [1] => Item Object
    (
    [url] => https://www.pdsolutions.ca/images/newwhiteheader.png
    [description] => AA training and exam
    [product_code] => AAtt-1306
    [unit_cost] => 60
    [quantity] => 1
    )
    )

    [subtotal] => 320
    For me it seems you have something wrong with your calculation (60*1 +
    60*1) * 1.05 ain't 320.
    [tax] => TaxItem Object
    (
    [amount] => 16
    [description] => GST
    [rate] => 5.00
    )

    Also 16 an't 5% of 120, you need to look into your summary and tax
    calculation.

    )
    Array ( [0] => items [1] => subtotal [2] => tax ) quantity 1 of AA training and exam quantity 1 of AA training and exam

    If the quantities are not what you expected, then you maybe didn't
    update the quantity before storing values to the session. Keep in mind
    that session values may need to be updated if someone posts new values.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)