create_function custom name?

  • Follow


Is there any way to choose the names that create_function assign to its
functions? Or, make it stop using the char(0) character before the "lambda"
part? I would like to be able to use the name to generate JS functions, but
the char(0) prohibits me from doing just that.

Thanks,
Daniel
0
Reply daniel138 (30) 12/9/2008 2:48:25 PM

Daniel Smedegaard Buus wrote:
> Is there any way to choose the names that create_function assign to its
> functions? Or, make it stop using the char(0) character before the "lambda"
> part? I would like to be able to use the name to generate JS functions, but
> the char(0) prohibits me from doing just that.
> 
> Thanks,
> Daniel

Why would you want to create a JS function with create_function?  JS 
runs on the client; PHP runs on the server.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Reply jstucklex (14410) 12/9/2008 4:43:33 PM


Daniel Smedegaard Buus escribi�:
> Is there any way to choose the names that create_function assign to its
> functions? Or, make it stop using the char(0) character before the "lambda"
> part? I would like to be able to use the name to generate JS functions, but
> the char(0) prohibits me from doing just that.

The NULL byte seems to be intentional, but the output is a regular 
string: you can manipulate it as any other string. A simple trim() 
removes the NULL byte and leaves the rest intact.


-- 
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://bits.demogracia.com
-- Mi web de humor al ba�o Mar�a: http://www.demogracia.com
--
0
Reply alvaroNOSPAMTHANKS (245) 12/9/2008 5:41:06 PM

2 Replies
21 Views

(page loaded in 0.058 seconds)


Reply: