php-general Digest 14 Sep 2011 07:39:27 -0000 Issue 7477

Topics (messages 314812 through 314834):

Re: Querying a database for 50 users' information: 50 queries or a WHERE array?
        314812 by: Dotan Cohen
        314813 by: Dotan Cohen
        314814 by: Dotan Cohen
        314815 by: Dotan Cohen
        314816 by: Alex Nikitin
        314832 by: chetan rane

What would you like to see in most in a text editor?
        314817 by: Brad Huskins
        314819 by: Brad Huskins
        314820 by: Robert Cummings
        314823 by: Alex Nikitin
        314824 by: Igor Escobar
        314825 by: Brad Huskins
        314826 by: Daniel Brown
        314827 by: tamouse mailing lists
        314828 by: Jim Lucas
        314829 by: James Yerge
        314830 by: Brad Huskins
        314831 by: Brad Huskins
        314833 by: Jim Lucas

What would you like to see in a text editor?
        314818 by: Brad Huskins

Sorry!
        314821 by: Brad Huskins

Re: htmlentities
        314822 by: Shawn McKenzie
        314834 by: Johan Lidström

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Tue, Sep 13, 2011 at 17:32, muad shibani <muad.shib...@gmail.com> wrote:
> Yes there is but all the IDs in one string like this
> $ids =  $id1.', '.$id2.', ' ;
> note : remove the last comma from the string
> the make the query like this:
> mysql_query("SELECT * FROM table WHERE
> userID= in($ids ) }

Thank you Muad!


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 17:34, Steve Staples <sstap...@mnsi.net> wrote:
> what criteria are you using to get the "stats" for these 50 users?
>

They are passed as an array into a function I'm cleaning up.


> also, wouldn't this be much better suited for the mysql mailing list?
>

Yes.


> if you know all the userids, then you could just do it as:
>
> $sql = "SELECT * FROM table WHERE userid IN (". implode(', ',
> $usersids) .")";
>
> not very elegant, and I am not sure that the IN is any better than doing
> 50 mysql calls, but this is only 1 call, and gets you the data.
>

This is exactly what I need, thanks!


> Are you querying the database to get the id's in the frist place?  if
> so, you could look at doing an inner join on the 2 tables.
>

Actually, I do suspect that is where it's coming from. But the calling
function is not in my hands.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 21:06, Steve Staples <sstap...@mnsi.net> wrote:
> I mentioned that implode earlier, but there is also the underlying
> question (which I also asked earlier)... how is he getting the 50 id's
> to populate?
>
> here are 2 other ways of skinning the cat:
>
> using an inner join:
> select table.* from table inner join othertable on (table.userid =
> othertable.userid) where (use the way your getting the 50 id's here);
>
> OR by using a subselect,
> select * from table where userid IN (select group_concat(userid,
> separator ', ') FROM othertable where (using logic here));
>
> guess it all depends on how you want to do it...  but that would make it
> 1 db query
>

I personally would stick with the inner join as I know that syntax,
but thanks for introducing me to the subselect. I have never seen
that.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 21:34, Alex Nikitin <niks...@gmail.com> wrote:
> And this will be faster or at least more efficient with a limit (e.g. limit
> 50) this way when you have found the 50 users in the "in" statement, you
> don't continue iterating through the rest of your data set...
>

The number is never exactly 50 but rather some arbitrary large number.
But there is no need for LIMIT, that is the purpose of the _INNER_
JOIN. INNER means to only return the matching rows.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 3:45 PM, Dotan Cohen <dotanco...@gmail.com> wrote:

> On Tue, Sep 13, 2011 at 21:34, Alex Nikitin <niks...@gmail.com> wrote:
> > And this will be faster or at least more efficient with a limit (e.g.
> limit
> > 50) this way when you have found the 50 users in the "in" statement, you
> > don't continue iterating through the rest of your data set...
> >
>
> The number is never exactly 50 but rather some arbitrary large number.
> But there is no need for LIMIT, that is the purpose of the _INNER_
> JOIN. INNER means to only return the matching rows.
>
>
> --
> Dotan Cohen
>
> http://gibberish.co.il
> http://what-is-what.com
>

Dotan,

IN (the function used in all of the queries above) is not the same as an
INNER_JOIN, inner join joins 2 tables, as you have already described, IN
however is a function that return 1 if the value being searched for is in
the array of its values or 0 if it is not, thus IN is not an inner join, but
a comparator function, thus if you are using IN, limit will indeed be more
efficient than it's omission for exactly the reason i have stated in my
previous post. Because your user array seems to be in php, and implode has
been a topic of discussion above as well, setting an adequate limit is a
simple task with the php's count function.

This is all ofcourse void if the user array being pulled from mysql, in
which case you could simply join the two tables to get your resulting data
set. The trick there is to use the USING clause which seems to run a lot
faster than any ON clause, or work on an optimized subselect, especially if
you are running a cluster.


--
The trouble with programmers is that you can never tell what a programmer is
doing until it’s too late.  ~Seymour Cray

--- End Message ---
--- Begin Message ---
Hi,

There are 2 peoblems with subselect

1. You cant use a limit on the nested select
2. Id the number of elements in the in clause exceeds the subselect buffer
you will run into performance issues ans eventually you query will be
doomed. Inner joins in,this is the best option for this . You can use a temp
table for this
On 14 Sep 2011 01:35, "Alex Nikitin" <niks...@gmail.com> wrote:
> On Tue, Sep 13, 2011 at 3:45 PM, Dotan Cohen <dotanco...@gmail.com> wrote:
>
>> On Tue, Sep 13, 2011 at 21:34, Alex Nikitin <niks...@gmail.com> wrote:
>> > And this will be faster or at least more efficient with a limit (e.g.
>> limit
>> > 50) this way when you have found the 50 users in the "in" statement,
you
>> > don't continue iterating through the rest of your data set...
>> >
>>
>> The number is never exactly 50 but rather some arbitrary large number.
>> But there is no need for LIMIT, that is the purpose of the _INNER_
>> JOIN. INNER means to only return the matching rows.
>>
>>
>> --
>> Dotan Cohen
>>
>> http://gibberish.co.il
>> http://what-is-what.com
>>
>
> Dotan,
>
> IN (the function used in all of the queries above) is not the same as an
> INNER_JOIN, inner join joins 2 tables, as you have already described, IN
> however is a function that return 1 if the value being searched for is in
> the array of its values or 0 if it is not, thus IN is not an inner join,
but
> a comparator function, thus if you are using IN, limit will indeed be more
> efficient than it's omission for exactly the reason i have stated in my
> previous post. Because your user array seems to be in php, and implode has
> been a topic of discussion above as well, setting an adequate limit is a
> simple task with the php's count function.
>
> This is all ofcourse void if the user array being pulled from mysql, in
> which case you could simply join the two tables to get your resulting data
> set. The trick there is to use the USING clause which seems to run a lot
> faster than any ON clause, or work on an optimized subselect, especially
if
> you are running a cluster.
>
>
> --
> The trouble with programmers is that you can never tell what a programmer
is
> doing until it’s too late. ~Seymour Cray

--- End Message ---
--- Begin Message ---
Hello all you php coders out there,

I'm doing an Open Source text editor (just a hobby) that's designed for PHP developers and is accessible through the web. This has been stewing for a while, and has gotten to the point where I can use it for my own work. I would like any feedback on things that people really like/dislike about their current editors, as I believe some of these things could be resolved in mine.

I currently have username/password protection (with Salted-Hash passwords), a file-system browser, file loading/saving, and syntax highlighting -- and these things seem to work reasonably well. As well, most things about the editor are scriptable with JavaScript. This would seem to imply that in a few weeks I would have something useful. So I would like to get some feedback on what features people would most want, since I am still at a very flexible stage in development.

If you would like to see what I have, you can go to un1tware.wordpress.com. You can also peruse the code at github.com/bhus/scriptr. In particular, the README on github gives a little bit better rationality for why something like this might be useful, and how things are currently structured.

--Brad

[ Yes, this is based on the layout of Linus' original post to comp.os.minix. ]
--- End Message ---
--- Begin Message ---
Hello all you php coders out there,

I'm doing an Open Source text editor (just a hobby) that's designed for PHP developers and is accessible through the web. This has been stewing for a while, and has gotten to the point where I can use it for my own work. I would like any feedback on things that people really like/dislike about their current editors, as I believe some of these things could be resolved in mine.

I currently have username/password protection (with Salted-Hash passwords), a file-system browser, file loading/saving, and syntax highlighting -- and these things seem to work reasonably well. As well, most things about the editor are scriptable with JavaScript. This would seem to imply that in a few weeks I would have something useful. So I would like to get some feedback on what features people would most want, since I am still at a very flexible stage in development.

If you would like to see what I have, you can go to un1tware.wordpress.com. You can also peruse the code at github.com/bhus/scriptr. In particular, the README on github gives a little bit better rationality for why something like this might be useful, and how things are currently structured.

--Brad

[ Yes, this is based on the layout of Linus' original post to comp.os.minix. ]
--- End Message ---
--- Begin Message ---
On 11-09-13 03:56 PM, Brad Huskins wrote:
Hello all you php coders out there,

I'm doing an Open Source text editor (just a hobby) that's designed for
PHP developers and is accessible through the web. This has been stewing
for a while, and has gotten to the point where I can use it for my own
work. I would like any feedback on things that people really
like/dislike about their current editors, as I believe some of these
things could be resolved in mine.

I currently have username/password protection (with Salted-Hash
passwords), a file-system browser, file loading/saving, and syntax
highlighting -- and these things seem to work reasonably well. As well,
most things about the editor are scriptable with JavaScript. This would
seem to imply that in a few weeks I would have something useful. So I
would like to get some feedback on what features people would most want,
since I am still at a very flexible stage in development.

If you would like to see what I have, you can go to
un1tware.wordpress.com. You can also peruse the code at
github.com/bhus/scriptr. In particular, the README on github gives a
little bit better rationality for why something like this might be
useful, and how things are currently structured.

I'm a big fan of editors that work in the terminal.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
+1 on terminal.

For gui-based ones, i like to be able to syntax check my code and run it
from within the editor window, tabs for dozens of files i usually have open
at once, highlight that supports many languages as i can be working on many
at once (php, css, js, ruby, python, C, lua, sql, for the ones i have open
in geany atm), shortcuts are essential for things like find or replace in a
selected area or what have you, regex support in search, and something that
can be themed with white on black.

For web-based ones, i never want to have to physically press anything to
save my work, and i expect it to be within a few words if i just closed the
browser and came back. It can't use any more resources than a usual web-page
and has to be responsive.

For other features to think about, built in version control system, ability
to sync with github or really any cvs/svn/git repo, diff tool integrated
into the editor, collaboration.

Essential 1: utmost security, if they pwn your servers, they should not be
able to have my data, this means that some part of what i pass to you in my
credentials needs to not even reside on your servers (for example you can
use the salted hash to check my the password, but the clear text version is
still needed to decrypt that user's data store) and for the ultra paranoid,
i should be able to further protect my data store with another password the
hash for which you don't store, but rather store the md5 of the hash.
Essential 2: reliability, i would like to be in an N+N+1 where the service
and my data are both highly available without performance degradation when
one of the services/servers goes kablewey (technical term)

Enjoy.


--
The trouble with programmers is that you can never tell what a programmer is
doing until it’s too late.  ~Seymour Cray



On Tue, Sep 13, 2011 at 4:35 PM, Robert Cummings <rob...@interjinn.com>wrote:

> On 11-09-13 03:56 PM, Brad Huskins wrote:
>
>> Hello all you php coders out there,
>>
>> I'm doing an Open Source text editor (just a hobby) that's designed for
>> PHP developers and is accessible through the web. This has been stewing
>> for a while, and has gotten to the point where I can use it for my own
>> work. I would like any feedback on things that people really
>> like/dislike about their current editors, as I believe some of these
>> things could be resolved in mine.
>>
>> I currently have username/password protection (with Salted-Hash
>> passwords), a file-system browser, file loading/saving, and syntax
>> highlighting -- and these things seem to work reasonably well. As well,
>> most things about the editor are scriptable with JavaScript. This would
>> seem to imply that in a few weeks I would have something useful. So I
>> would like to get some feedback on what features people would most want,
>> since I am still at a very flexible stage in development.
>>
>> If you would like to see what I have, you can go to
>> un1tware.wordpress.com. You can also peruse the code at
>> github.com/bhus/scriptr. In particular, the README on github gives a
>> little bit better rationality for why something like this might be
>> useful, and how things are currently structured.
>>
>
> I'm a big fan of editors that work in the terminal.
>
> Cheers,
> Rob.
> --
> E-Mail Disclaimer: Information contained in this message and any
> attached documents is considered confidential and legally protected.
> This message is intended solely for the addressee(s). Disclosure,
> copying, and distribution are prohibited unless authorized.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
+ extensible plug-ins.


Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar <http://www.twitter.com/igorescobar>





On Tue, Sep 13, 2011 at 6:13 PM, Alex Nikitin <niks...@gmail.com> wrote:

> +1 on terminal.
>
> For gui-based ones, i like to be able to syntax check my code and run it
> from within the editor window, tabs for dozens of files i usually have open
> at once, highlight that supports many languages as i can be working on many
> at once (php, css, js, ruby, python, C, lua, sql, for the ones i have open
> in geany atm), shortcuts are essential for things like find or replace in a
> selected area or what have you, regex support in search, and something that
> can be themed with white on black.
>
> For web-based ones, i never want to have to physically press anything to
> save my work, and i expect it to be within a few words if i just closed the
> browser and came back. It can't use any more resources than a usual
> web-page
> and has to be responsive.
>
> For other features to think about, built in version control system, ability
> to sync with github or really any cvs/svn/git repo, diff tool integrated
> into the editor, collaboration.
>
> Essential 1: utmost security, if they pwn your servers, they should not be
> able to have my data, this means that some part of what i pass to you in my
> credentials needs to not even reside on your servers (for example you can
> use the salted hash to check my the password, but the clear text version is
> still needed to decrypt that user's data store) and for the ultra paranoid,
> i should be able to further protect my data store with another password the
> hash for which you don't store, but rather store the md5 of the hash.
> Essential 2: reliability, i would like to be in an N+N+1 where the service
> and my data are both highly available without performance degradation when
> one of the services/servers goes kablewey (technical term)
>
> Enjoy.
>
>
> --
> The trouble with programmers is that you can never tell what a programmer
> is
> doing until it’s too late.  ~Seymour Cray
>
>
>
> On Tue, Sep 13, 2011 at 4:35 PM, Robert Cummings <rob...@interjinn.com
> >wrote:
>
> > On 11-09-13 03:56 PM, Brad Huskins wrote:
> >
> >> Hello all you php coders out there,
> >>
> >> I'm doing an Open Source text editor (just a hobby) that's designed for
> >> PHP developers and is accessible through the web. This has been stewing
> >> for a while, and has gotten to the point where I can use it for my own
> >> work. I would like any feedback on things that people really
> >> like/dislike about their current editors, as I believe some of these
> >> things could be resolved in mine.
> >>
> >> I currently have username/password protection (with Salted-Hash
> >> passwords), a file-system browser, file loading/saving, and syntax
> >> highlighting -- and these things seem to work reasonably well. As well,
> >> most things about the editor are scriptable with JavaScript. This would
> >> seem to imply that in a few weeks I would have something useful. So I
> >> would like to get some feedback on what features people would most want,
> >> since I am still at a very flexible stage in development.
> >>
> >> If you would like to see what I have, you can go to
> >> un1tware.wordpress.com. You can also peruse the code at
> >> github.com/bhus/scriptr. In particular, the README on github gives a
> >> little bit better rationality for why something like this might be
> >> useful, and how things are currently structured.
> >>
> >
> > I'm a big fan of editors that work in the terminal.
> >
> > Cheers,
> > Rob.
> > --
> > E-Mail Disclaimer: Information contained in this message and any
> > attached documents is considered confidential and legally protected.
> > This message is intended solely for the addressee(s). Disclosure,
> > copying, and distribution are prohibited unless authorized.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--- End Message ---
--- Begin Message ---
On 09/13/2011 04:35 PM, Robert Cummings wrote:
On 11-09-13 03:56 PM, Brad Huskins wrote:
Hello all you php coders out there,

I'm doing an Open Source text editor (just a hobby) that's designed for
PHP developers and is accessible through the web. This has been stewing
for a while, and has gotten to the point where I can use it for my own
work. I would like any feedback on things that people really
like/dislike about their current editors, as I believe some of these
things could be resolved in mine.

I currently have username/password protection (with Salted-Hash
passwords), a file-system browser, file loading/saving, and syntax
highlighting -- and these things seem to work reasonably well. As well,
most things about the editor are scriptable with JavaScript. This would
seem to imply that in a few weeks I would have something useful. So I
would like to get some feedback on what features people would most want,
since I am still at a very flexible stage in development.

If you would like to see what I have, you can go to
un1tware.wordpress.com. You can also peruse the code at
github.com/bhus/scriptr. In particular, the README on github gives a
little bit better rationality for why something like this might be
useful, and how things are currently structured.

I'm a big fan of editors that work in the terminal.

Cheers,
Rob.

Thanks for the input.

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 18:50, Brad Huskins <brad.husk...@gmail.com> wrote:
>
> Thanks for the input.

    Brad, I'd be willing to bet that, if you added in the ability for
multiple users to simultaneously view and edit the same file without
issues of corruption and such (think along the same lines as Google
Docs), you'd have quite a winner on your hands there.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings <rob...@interjinn.com> wrote:
> I'm a big fan of editors that work in the terminal.

You'll get my emacs when you pry it out of my cold dead hands.

--- End Message ---
--- Begin Message ---
On 9/13/2011 5:23 PM, tamouse mailing lists wrote:
> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings <rob...@interjinn.com> wrote:
>> I'm a big fan of editors that work in the terminal.
> 
> You'll get my emacs when you pry it out of my cold dead hands.
> 

+1

mg too



--- End Message ---
--- Begin Message ---
On 09/13/2011 08:40 PM, Jim Lucas wrote:
> On 9/13/2011 5:23 PM, tamouse mailing lists wrote:
>> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings <rob...@interjinn.com> 
>> wrote:
>>> I'm a big fan of editors that work in the terminal.
>> You'll get my emacs when you pry it out of my cold dead hands.
>>
> +1
>
> mg too
>
>
>

I'd have to go agree with the exception of s/emacs/vi/ :P

--- End Message ---
--- Begin Message ---
Daniel,

Thanks for your response. That's the direction I was thinking of taking this, but wanted to get some input before I got ahead of myself.

-Brad.

On 09/13/2011 06:54 PM, Daniel Brown wrote:
On Tue, Sep 13, 2011 at 18:50, Brad Huskins<brad.husk...@gmail.com>  wrote:

Thanks for the input.

     Brad, I'd be willing to bet that, if you added in the ability for
multiple users to simultaneously view and edit the same file without
issues of corruption and such (think along the same lines as Google
Docs), you'd have quite a winner on your hands there.



--- End Message ---
--- Begin Message ---
Oh geez. Didn't mean to start a flame war...

On 09/13/2011 08:56 PM, James Yerge wrote:
On 09/13/2011 08:40 PM, Jim Lucas wrote:
On 9/13/2011 5:23 PM, tamouse mailing lists wrote:
On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings<rob...@interjinn.com>  wrote:
I'm a big fan of editors that work in the terminal.
You'll get my emacs when you pry it out of my cold dead hands.

+1

mg too




I'd have to go agree with the exception of s/emacs/vi/ :P


--- End Message ---
--- Begin Message ---
On 9/13/2011 7:11 PM, Brad Huskins wrote:
Oh geez. Didn't mean to start a flame war...

Quit fanning it then... :)


On 09/13/2011 08:56 PM, James Yerge wrote:
On 09/13/2011 08:40 PM, Jim Lucas wrote:
On 9/13/2011 5:23 PM, tamouse mailing lists wrote:
On Tue, Sep 13, 2011 at 3:35 PM, Robert
Cummings<rob...@interjinn.com> wrote:
I'm a big fan of editors that work in the terminal.
You'll get my emacs when you pry it out of my cold dead hands.

+1

mg too




I'd have to go agree with the exception of s/emacs/vi/ :P




--- End Message ---
--- Begin Message ---
Hello all you PHP devs,

I'm building an Open Source text editor accessible through the web. It 
has been brewing for a while in one form or another. But I think I 
finally have something solid to build on. I would like some feedback on 
things people like/dislike about their current editors.

I currently have a basic system working with a login, file browser, 
ability to load/save files and syntax highlighting working. All 
keystrokes are sent through a client-side JavaScript API built on JQuery. 
This would seem to imply that something usable is not more than a few 
weeks away, so I figured I would get some input now while things are 
still quite flexible. All suggestions are welcome, though not all will be 
implemented.

If you want, you can visit the web site for the project at 
un1tware.wordpress.com. There's a link to a video demo, as well as a the 
current version of the source code to try out.

As well, the project can be found at github.com/bhus/scriptr. I have 
tried to make the README readable and yet comprehensive.

--Brad

[And yes, this message is modeled after Linus' original post to 
comp.os.minix]

--- End Message ---
--- Begin Message --- My apologies for the triplicate errors. My newsgroup client is doing screwy things.

Again, I am SO sorry for the multiple posts.

/Brad.

--- End Message ---
--- Begin Message ---
On 09/13/2011 01:38 PM, Ron Piggott wrote:
> 
> Is there a way to only change accented characters and not HTML (Example: <p> 
> </p> <a href =””> </a> )
> 
> The syntax
> 
> echo htmlentities( stripslashes(mysql_result($whats_new_result,0,"message")) 
> ) . "\r\n";
> 
> is doing everything (as I expect).  I store breaking news within the database 
> as HTML formatted text.  I am trying to see if a work around is available?  
> Do I need to do a variety of search / replace to convert the noted characters 
> above back after htmlentities ?
> 
> (I am just starting to get use to accented letters.)
> 
> Thanks a lot for your help.
> 
> Ron
> 
> The Verse of the Day
> “Encouragement from God’s Word”
> http://www.TheVerseOfTheDay.info  
> 

If it is meant to be HTML then why run htmlentities(), especially before
storing it in the DB?

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
On 13 September 2011 23:01, Shawn McKenzie <nos...@mckenzies.net> wrote:

> On 09/13/2011 01:38 PM, Ron Piggott wrote:
> >
> > Is there a way to only change accented characters and not HTML (Example:
> <p> </p> <a href =””> </a> )
> >
> > The syntax
> >
> > echo htmlentities(
> stripslashes(mysql_result($whats_new_result,0,"message")) ) . "\r\n";
> >
> > is doing everything (as I expect).  I store breaking news within the
> database as HTML formatted text.  I am trying to see if a work around is
> available?  Do I need to do a variety of search / replace to convert the
> noted characters above back after htmlentities ?
> >
> > (I am just starting to get use to accented letters.)
> >
> > Thanks a lot for your help.
> >
> > Ron
> >
> > The Verse of the Day
> > “Encouragement from God’s Word”
> > http://www.TheVerseOfTheDay.info
> >
>
> If it is meant to be HTML then why run htmlentities(), especially before
> storing it in the DB?
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Perhaps something like this might help you

$content =
htmlspecialchars_decode(htmlentities($content,ENT_NOQUOTES,"ISO-8859-1"),ENT_NOQUOTES);

or perhaps

$table_all  =
get_html_translation_table(HTML_ENTITIES,ENT_NOQUOTES,"ISO-8859-1");
$table_html = get_html_translation_table(HTML_SPECIALCHARS,ENT_NOQUOTES);
$table_nonhtml = array_diff_key($table_all,$table_html);
$content1 = strtr($content1,$table_nonhtml);
$content2 = strtr($content2,$table_nonhtml);

if using it multiple times.

-- 
"It is not possible to simultaneously understand and appreciate the Intel
architecture" --Ben Scott

--- End Message ---

Reply via email to