Hello all. Hope you are well!

This is just a matter of "I can't remember what tool I used to use, but I know it exists..."

I want copy a block of PHP and "convert to HTML", where it would fix the PHP-specific characters, so any code which would normally be parsed as PHP would "instantly" become HTML friendly as NCR's or HTML entities, for regular HTML output for storing quick notes w/out it throwing PHP errors.

With a thousand text editors, and each having a hundred menus, i thought I'd just shoot that question out here to see if it rings a bell w/ anyone. Anything come to mind off the top of your head?

I realize there's as many websites that process strings and all that. I like quick n fast, like notepad2. But I don't think it has that function.

Thank you!

    Hey there NogDog !
    Naw, i'm sorry. I was looking for something like a "right click" in a text editor.

    I might have been thinking of Programmer's Notepad (Scintilla based), which will export a PHP file as HTML for viewing/ sharing. Basically just the idea of turning $ into $ , and the greater-than less-than signs, etc.

    kind of interested to learn what others' favorite editors are, i suppose. but, specifically that little function. i just happened to be making some notes earlier, and realized i missed having that. couldn't remember what editor i used to use that would allow selecting a lined, and quick convert "code" to HTML.

    But thank you! I wasn't aware of those PHP functions!
    (hmm.. maybe that's a better approach anyway. i'll have to try it. )

    Cheers!

      Well, I got curious, and I found a (slightly clunky) way to do it in VS Code (my current code editor):

      • Add the "Print" extension to VS Code
      • Open settings ("⌘," on Mac) and search for "printing"
      • Un-check the "Print and close" option

      Now when editing the file, just right-click within it and choose the "Print" option. It will pop-up in your web browser, and then you can do a "view source" if you want to copy/paste the HTML (or I suppose just save the file from the browser menus).

      a month later

      Hey there NogDog !!
      Yes! That's cool. I haven't tried yet, but it sounds like the type of thing I'd do!
      😁

      Sorry for late reply. Holidays, etc.

      Haha. VS Code, huh... right!? It's pretty crazy how it basically does everything. I'll bet a lot of software companies are pretty bummed out about it. Like Bob Dylan penned so many years ago though: the Times, and what not. 🙂
      Ugh. ChatGPT isn't even 2 months old yet, and already they did a skit on SNL about that...
      but, i digress.

      I never did get around to trying those PHP funcs. Thank you for reminding me!

        Write a Reply...